Syber Blog - Your Source 4 All Web 2.0

Send Email With PHP From Some Other Address

Posted by Syberplanet on January 15th, 2009 - 473 views

mail-final

This script just adds another functionality to the PHP Mail script that was posted earlier. The following script will add a send from option to the mail script and will allow the user to add his/her Name, E-mail Address in the headers.

<?php

$Name = "Syber Blog";                                                                        //senders name
$email = "info@syberplanet.net";                                                     //senders e-mail address
$recipient = "someone@email.com";                                            //recipient
$mail_body = "Syberplanet.net - Games, Hacks, News and more...";                             //body
$subject = "Check Out Syberplanet";                                                        //subject
$header = "From: ". $Name . " <" . $email . ">\r\n";                              //optional headerfields

mail($recipient, $subject, $mail_body, $header);                 //mail command :)
?>

If you enjoyed this post, make sure you subscribe to our RSS feed!

Tags: , , , ,
Posted in PHP | 7 Comments »


7 Responses to “Send Email With PHP From Some Other Address”

  1. Every time i come here I am not dissapointed, nice post


  2. Thanks a lot.


  3. Does anyone else have any experience with this?


  4. I really enjoyed reading this page…Thanks for this :)


  5. I wanted to comment and thank the author, good stuff


  6. Well said, finally a good report on this stuff


  7. Great articles & Nice a site


Leave a Reply


Advertise on Syber Blog
Earn $$ with WidgetBucks!