php mail() problem

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
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

php mail() problem

Post by dharprog »

Hi

I have a site in which when i send email by using the mail() function its reaching to bulk folder but not to the inbox.

Why its happening to me. What are the requirements i have to take to send a mail by using mail() function in php.

Here is the code function code. Is there any wrong with this?

Code: Select all

mail($remail,$subject,$mesg,"From:$strFrom\r\nReply-to: $strFrom\r\nContent-type: text/html; charset=us-ascii");
Thank you very much.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

If you'd like to send HTML email, you're better of using a fully-fledged mailing library like Swiftmailer.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Bad code doesn't put it into the Bulk mail folder, bad e-mail does. Sending a pure HTML e-mail is oftentimes seen as spam. You should send an HTML e-mail with a plaintext alternative. Swiftmailer does this very easily for you.
User avatar
maliskoleather
Forum Contributor
Posts: 155
Joined: Tue May 15, 2007 2:19 am
Contact:

Post by maliskoleather »

use Swiftmailer. read this.
Post Reply