php_guy Posted October 28, 2010 Share Posted October 28, 2010 Hi all, I'm coding an automated mailer for a dentist office. They set appointment dates through a web interface, and then this appointment is mailed to the customer via PHP's mail() function. However, some users are not receving the mail. They claim that it is not even in the junk mail folder. Is it because I'm setting or not setting certain properties in the header? Should I be setting something else? Here is my code ini_set("SMTP", "mail.isp-provider.net"); $headers = 'From: Schedule Manager <schedule@address.com>' . "\r\n" . 'Reply-To: Schedule Manager <schedule@address.com>' . "\r\n" . 'Bcc: internal@address.com' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($customerAddress, $subject, $body, $headers); Note that customerAddress, subject, and body are all just regular normal strings. As I said, it works for most customers, but some customers do not receive the emails. Quote Link to comment Share on other sites More sharing options...
abdfahim Posted October 28, 2010 Share Posted October 28, 2010 php mail() function is not a perfect thing to use. Many a times, google/yahoo or some other email providers block the addresses of your hosting, as a result the mail never reached in the destination (so, not in the junk box also). Sometimes, you might face that you sent to two email addresses in different domain (say, gmail and hotmail), one got delivered, other not. So mail() function, though is very simple and easy to use, not suitable always if you want reliable email delivery. To me, best thing is to use smtp server of your hosting or any gmail address if your hosting support FSOCKOPEN. Quote Link to comment Share on other sites More sharing options...
php_guy Posted October 28, 2010 Author Share Posted October 28, 2010 Hi abdbuet, Not quite sure what you meant by the following ...some other email providers block the addresses of your hosting... could you please elaborate? You mentioned a good solution would be to use the smtp server of my host... I'm supplying the SMTP of their ISP. Wouldn't this be reliable enough? Thanks Quote Link to comment Share on other sites More sharing options...
abdfahim Posted October 29, 2010 Share Posted October 29, 2010 okay, what I faced at early days was, whenever I used mail() function, my emails never delivered to the yahoo addresses, but had no problem with hotmail. The main reason is, sometimes those email providers can drop all the mails from some certain domain if extensive spamming occurs from that area. Because as you know, anyone can misuse mail() function to spam mailbox of people. What I can suggest to us google smtp, which I feel most reliable. Just have a gmail account, enable POP/IMAP from account settings and then use some built-in classes like http://phpmailer.worxware.com/index.php?pg=sf&p=dl. And if you want email address like you@yourdomain.com, you can even havethat using Google App ... this is totally independent whether you get SMTP from your host. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.