Jump to content
MakeWebGames

Mail help


Bennyh789

Recommended Posts

Hello all,

I am using v2 and I am looking to send an email to the user when they receive a mail. I have put the code with:

mail( $ir['email'],

Testing email

Thanks,

Bennyh ", "From: [email protected]");

print "Message sent.<br />

<a href='mailbox.php'>> Back</a>";

}

The code above obviously sends the email to the sender and works well however how will I enter the code so the email goes to the reciever?

I have tried all sorts of different combinations with no success a few below:

mail( $r['email'],

mail( $to['email'],

mail( userid = $to['email'],

Thanks in advance

Ben

Link to comment
Share on other sites

here is something i use:

$subject = "Your Email Confirmation";
       $headers = "From: no-reply@" .$_SERVER['SERVER_NAME']. "\r\n";
   $headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
   $headers .= "MIME-Version: 1.0 \r\n";
   $headers .= "Content-Type: text/html; charset=UTF-8 \r\n";

   $body = "<html><body>";
   $body .= "Your email body can go here";
   $body .= "</body></html>";    

mail(filter_var($emailTo,FILTER_SANITIZE_EMAIL), $subject, $body, $headers);

 

Hope this helps

Edited by KyleMassacre
Link to comment
Share on other sites

  • 2 weeks later...

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.   Paste as plain text instead

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