spires Posted September 19, 2006 Share Posted September 19, 2006 Hi to one and all.I'm trying to make so when i send an email, it will have a from address. I can do this, but, when i use the $header the 'from' dont work. Can someone please tell me where i'm going wrong. ;DThanks[code]$link = '<a href="http://www.theeventorganiser.com/login.php">login</a>'; $to = '[email protected]'; $from = '[email protected]'; $subject = 'Hi Ric, '.$first_name.' wants you to create their profile'; $message = 'Hi Ric,<br> '.$first_name.' wants you to create their profile<br><br> Here is there username and password<br> USERNAME = '.$usname.'<br> PASSWORD = '.$pword.'<br><br> Please login here<br>'.$link.''; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, $subject, $message, "FROM: ".$from."", $headers,);[/code] Link to comment https://forums.phpfreaks.com/topic/21295-mailfrom/ Share on other sites More sharing options...
spires Posted September 19, 2006 Author Share Posted September 19, 2006 Hi, I've now got this code.This works, but i can get the from and the MIME to work together. Does anyone know how to join the two together?Thanks for looking [code] $link = '<a href="http://www.theeventorganiser.com/login.php">login</a>'; $to = '[email protected]'; $from = '[email protected]'; $subject = 'Hi Ric, '.$first_name.' wants you to create their profile'; $message = 'Hi Ric,<br> '.$first_name.' wants you to create their profile<br><br> Here is there username and password<br> USERNAME = '.$usname.'<br> PASSWORD = '.$pword.'<br><br> Please login here<br>'.$link.''; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $header2 = "FROM: ".$from.""; mail($to, $subject, $message, $header2, $headers);[/code] Link to comment https://forums.phpfreaks.com/topic/21295-mailfrom/#findComment-94769 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.