Jump to content

mail() bare line feed problem on IIS mail server??


jonsamwell

Recommended Posts

hi all,

 

The below script works fine sending emails however when i send emails internal to my hosts network domain they are not getting recieved; the tech support at my webhost has narrowed it down to bareline feed being produced which is causing the error i.e. '\n' instead of '\r\n' which is now fixed.

 

I am pulling my hair out over this one as it works fine to emails outside the webhosts network but not internal ones i.e. different server with there network.

 

Has anyone had this problem before/ know how to fix it???

 

Help would be BRILLIANT!!!

 

function newCompanyMail($clientName, $username, $password, $recipient, $companyKey, $moduleCost)
{//sends a email to the company admin user containing company details
    $senderemail = '[email protected]';
    $sendername = 'Company Name\r\n';
    $mailheader = "From: $senderemail\r\n";
    $mailheader .= "Reply-To: No-Reply\r\n";
    $moduleCost = number_format($moduleCost, 2);

    //email variables
    $subject = 'blah blah :: blah blah:: blah blah - blah blah\r\n';

    //Message
    $message = "blah blah.\r\n\r\n";
    $message .= "blah blah ";
    $message .= "blah blah.\r\n\r\n";
    $message .= "You can login to your account at http://www.mydomain.co.uk/blah/\r\n\r\n";
    $message .= "blah blah.\r\n\r\n";
    $message .= "Your Compnay Account Details:\r\n\r\n";
    $message .= "   Company Name:   $clientName\r\n";
    $message .= "   Admin Username: $username\r\n";
    $message .= "   Admin Password: $password\r\n";
    $message .= "   Company Key:    $companyKey\r\n";
    $message .= "   Module Cost:    £$moduleCost\r\n\r\n";
    $message .= "NOTE: blah blah.\r\n\r\n";
    $message .= "For technical support please email [email protected].\r\n\r\n";
    $message .= "Best regards,\r\n\r\n\r\n";
    $message .= "Company Name\r\n";

    ini_set('sendmail_from', $senderemail);

    mail($recipient, $subject, $message, $mailheader) or die ("Failure");
}

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.