MSUK1 Posted November 5, 2010 Share Posted November 5, 2010 in my php mail i use this code: $success = mail($EmailFrom, $Subject, $Body2, "From: <$EmailTo>"); and here are the variables for emial from and email to, $EmailFrom = Trim(stripslashes($_POST['email'])); $EmailTo = "[email protected]"; when the email is received the sender just appears as [email protected] how can i have it say MSUKGroup Auto Responder or something? instead of just repeat the address? Link to comment https://forums.phpfreaks.com/topic/217897-adding-name-to-sender/ Share on other sites More sharing options...
Psycho Posted November 5, 2010 Share Posted November 5, 2010 Look at how the headers are created in example #4: http://us.php.net/manual/en/function.mail.php Link to comment https://forums.phpfreaks.com/topic/217897-adding-name-to-sender/#findComment-1130889 Share on other sites More sharing options...
MSUK1 Posted November 6, 2010 Author Share Posted November 6, 2010 Thankyou Link to comment https://forums.phpfreaks.com/topic/217897-adding-name-to-sender/#findComment-1131117 Share on other sites More sharing options...
MSUK1 Posted November 6, 2010 Author Share Posted November 6, 2010 ok so started to use HTML emails, how can i now add php variables into that email ive tried this not working? done some research on google firsts too, tried another metod of using " . $var . " but no luck? $message = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MSUKGroup</title> </head> <body> <table style="width: 100%" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top"> <table style="width: 500px" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top"> <img src="http://www.msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> <tr> <td valign="top" style="margin-top:2px" class="maincontent"> <p>Dear {$name} ,</p> <p> </p> <p>Thankyou for contacting us via our online form, we have collected the following from your query:</p> <ul> <li>name:<br />{$name} </li> <li>email:<br />$email} </li> <li>website:<br />$web} </li> <li>tel:<br />{$tel} </li> <li>subject:<br />{$sub} </li> <li>message:<br />{$message} </li> </ul> <p>If their is anything else we can assist you with please call us, our number can be found on our website at <a href="http://www.msukgroup.co"> <span class="footer2"> http://www.msukgroup.co</span></a> </p> <p> </p> <p> </p> </td> </tr> <tr> <td class="footer1" valign="top"> </td> </tr> </table> </td> </tr> </table> </body> </html> '; Link to comment https://forums.phpfreaks.com/topic/217897-adding-name-to-sender/#findComment-1131129 Share on other sites More sharing options...
mjc302 Posted November 6, 2010 Share Posted November 6, 2010 " . $var . " should be ' . $var . ' Link to comment https://forums.phpfreaks.com/topic/217897-adding-name-to-sender/#findComment-1131132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.