Jump to content

Making exchange IMF compliant email using mail()


randyvogl

Recommended Posts

So here is the premise of the issue I have two places on my website where I am attempting to automatically send emails if a form is submitted using the mail() function. The first is a registration page, this works great email completes successfully and everyone is happy. The second location is the problem, it is being stopped by exchange IMF I believe it is this line that is causing the error when I print this line

$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

it displays the following results "From: Do Not Reply" and missed the whole right half which has the send from: which I believe is flagging it in IMF but I can't figure out what is wrong with this syntax? Any thoughts? Ohh and this is the exact same code that is used on the other outbound email that works correctly which adds to my confusion.

 

     //this is a section of code to send the user an email confirmation with their username and password attached
              $Name = "Do Not Reply"; //senders name
              $email = "donotreply@xxxxxxxx.com"; //senders e-mail address
              $recipient = $_POST['email']; //recipient
              $mail_body = "Your file has been uploaded"; //mail body
              $subject = "Upload"; //subject
              $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
              ini_set('Do not reply', 'donotreply@xxxxxxxx.com'); //Suggested by
              mail($recipient, $subject, $mail_body, $header); //mail command 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.