Jump to content

Archived

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

spires

mail(from:) ??

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      = 'spires1@mail.com';
$from      = 'spires1@mail.com';
$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]

Share this post


Link to post
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      = 'spires1@mail.com';
$from      = 'spires1@mail.com';
$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]

Share this post


Link to post
Share on other sites

×

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.