Jump to content

mail(from:) ??


spires

Recommended Posts

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

Thanks

[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

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

Archived

This topic is now archived and is closed to further replies.

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