PHP Mail to 3rd parties - spam or not?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zachalbert
Forum Newbie
Posts: 13
Joined: Sun Jan 04, 2009 11:32 pm

PHP Mail to 3rd parties - spam or not?

Post by zachalbert »

My website is looking at offering greeting cards. It's a basic ecard setup sending php mail, nothing fancy. Users select a card, type their message and who they want to send it to, and it gets sent (not a link to the card, but the card itself).

What are the chances that this would be flagged as spam? Is there anyway to make sure that it would be safe from a coding perspective?
User avatar
paqman
Forum Contributor
Posts: 125
Joined: Sun Nov 14, 2004 7:41 pm
Location: Burnaby, BC, Canada

Re: PHP Mail to 3rd parties - spam or not?

Post by paqman »

When mailing using php through an online form always watch out for mail injection: http://www.w3schools.com/php/php_secure_mail.asp. I highly recommend reading it, as my sites were being used for mail injection without my knowledge for quite some time.

As for your mail being tagged as spam, that's a tough one to get around. Make sure you provide as much information as you can through the mail headers - http://ca.php.net/manual/en/function.mail.php - see example #4. Maybe someone who knows more on the subject could back me up or correct me, but I'd assume one of the primary spam-detection methods would be mail without a good 'from' field (name and email).

Hope that helps.
Post Reply