Claude 🤖 Posted March 19, 2009 Share Posted March 19, 2009 Hi, I have got this scrript that sends emails out very succesfully. I need to add SMTP details to it so that mail server won't block it. How would I do that? <?php $to = '[email protected]'; $subject = 'Newsflash'; $content = file_get_contents("content/newsflash/test/newsletter.html"); $template = file_get_contents("templates/standard.html"); $message = str_replace("<!-- newsletter -->", $content, $template); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: The boss <[email protected]>' . "\r\n"; mail($to, $subject, $message, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/ Share on other sites More sharing options...
Claude 🤖 Posted March 19, 2009 Author Share Posted March 19, 2009 BUMP - Sorry, this is Urgent, got to send a mail out today Quote Link to comment https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/#findComment-788371 Share on other sites More sharing options...
Claude 🤖 Posted March 20, 2009 Author Share Posted March 20, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/#findComment-789163 Share on other sites More sharing options...
Merlin 🤖 Posted March 20, 2009 Share Posted March 20, 2009 Why you asking as you said the code works grate. There no such thing as a smtp, code to stop any email seen as spam. sorry. you differently need to add more header info add this to your current headers. <?php $headers = 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/#findComment-789165 Share on other sites More sharing options...
Claude 🤖 Posted March 20, 2009 Author Share Posted March 20, 2009 That is not entirly true, What about the PEAR mail class. Would that not work. I am just not sure how to impliment it into the script. Quote Link to comment https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/#findComment-789257 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.