Jump to content

SMTP Mime Mailer


kindoman

Recommended Posts

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);
?>

Link to comment
https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/
Share on other sites

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";
?>

 

Link to comment
https://forums.phpfreaks.com/topic/150116-smtp-mime-mailer/#findComment-789165
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.