jackr1909 Posted March 4, 2012 Share Posted March 4, 2012 Hi, I need to send automated HTML emails with PHP for my web-server. I have SMTP with Postfix and Sendmail. When i send an email, it just goes to the spam folder of the mail client (tried with GMAIL as well as Microsoft outlook). Could i have the code for sending emails so they don't go to the spam folder. With full headers, etc. Thanks a lot, Jack Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/ Share on other sites More sharing options...
Pikachu2000 Posted March 4, 2012 Share Posted March 4, 2012 If you want someone to write this for you, I can move the thread to the freelance forum, and you can hire someone. Is that what you want? Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323886 Share on other sites More sharing options...
l0gic Posted March 4, 2012 Share Posted March 4, 2012 Jackr, care to post the code you're using at the moment and see if we can help or point you in the right direction? At the moment your post is a bit like me going to an auto-store and asking, "My car needs a new head gasket, can I have one please?" Without letting them know what car model, make or year of car I drive. Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323906 Share on other sites More sharing options...
requinix Posted March 4, 2012 Share Posted March 4, 2012 Another option is using something like PHPMailer which takes care of many of the things that tend to get emails flagged as spam. Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323910 Share on other sites More sharing options...
l0gic Posted March 4, 2012 Share Posted March 4, 2012 I'll jump the gun and bet it's the same issue I used to have. I got around it by changing the "From:" header to "mydomain@myhost.com" (the actual account sending the email) and adding a "Reply-To:" header for "someone@mydomain.com" (the address you want people to reply to) If not set like this and if the originating domain "myhost.com" and the "From" header domain "mydomain.com" do not match, I imagine the spam filters will mark it as spam. It should look kinda like this.. <?php $header .= "Reply-To: Some One <someone@mydomain.com>\n"; $header .= "Return-Path: Some One <someone@mydomain.com>\n"; $header .= "From: Some One <mydomain@myhost.com>\n"; $header .= "Organization: My Organization\n"; $header .= "Content-Type: text/plain\n"; mail("to@wherever.com", "Message Subject", "This is my message.", $header); ?> Edit: Fixed typo. Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1323914 Share on other sites More sharing options...
jackr1909 Posted March 6, 2012 Author Share Posted March 6, 2012 If you want someone to write this for you, I can move the thread to the freelance forum, and you can hire someone. Is that what you want? No thanks, but some more helpful users offered a better suggestion, Thanks anyway Quote Link to comment https://forums.phpfreaks.com/topic/258273-full-mail/#findComment-1324319 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.