Jump to content

FROM address in mail() function


salman_ahad@yahoo.com

Recommended Posts

$to_email = "info@ideatoceo.com";
$Headers = 'From: ansari@ideatoceo.com' . "\r\n" .
'Reply-To: ansari@ideatoceo.com';
$subject = "Greetings";
$message = "Hi";

mail($to_email, $subject, $message, $Headers);           //proper syntax to use FROM address???

 

Next time, just check the documentation

 

http://php.net/manual/en/function.mail.php

Link to comment
Share on other sites

I am already using Headers to attach my email template.

 

I am still getting mail as From : Myname@xxxxx.12345.xxxx.server.net  (I am still not getting From : ansari@ideatoceo.com)

 

My code

 

<?php
$to_email = "mohammed.ahad@gmail.com";
$Headers = 'From: ansari@ideatoceo.com' . "\r\n" .
$subject = "Greetings";
$message = ''
. '<table width="676">'
. 	'<tr>'
. 		'<td width="30" height="52"><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="50" alt="Corner" /></td>'
. 		'<td width="600"><img src="http://www.ideatoceo.com/emails/Top.gif" width="600" height="50" alt="Top" /></td>'
. 		'<td width="30"><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="50" alt="Corner" /></td>'
. 	'</tr>'
.  	'<tr>'
.		'<td><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="200" alt="Lside" /></td>'
.		'<td> <p>Asalam-alikum,</p>'
.		'<p>This EID get 30 calling minutes to Saudia Arabia FREE from <a href="http://www.rebtel.com/u/0131701413" target="_blank">Rebtel </a> , for New or Returning users. </p>'
.		'<p>Visit add credit and use the promotional code "Saudi30".</p>'
.		'<p><img src="http://www.ideatoceo.com/emails/Center.gif" alt="Center" width="600" height="8" align="absbottom" /></p>'
.		'<p>Awareness brought to you by <a href="http://www.ideatoceo.com/islam-emails.php" target="_blank">IdeatoCEO </a></p></td>'
.		'<td><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="200" alt="Rside" /></td>'
.	'</tr>'
.	'<tr>'
.		'<td><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="25" alt="Corner" /></td>'
.		'<td><img src="http://www.ideatoceo.com/emails/Bottom.gif" width="600" height="25" alt="Bottom" /></td>'
.		'<td><img src="http://www.ideatoceo.com/emails/Side.gif" width="30" height="25" alt="Corner" /></td>'
.	'</tr>'
.'</table>'
.'<table>'
  	.'Forwarding Hadith to friends is now easy, visit <a href="http://www.ideatoceo.com/islam-emails.php" target="_blank">IdeatoCEO </a><br />'
.'<a href="http://www.ideatoceo.com/islam/emails.php" target="_blank">Unsubscribe</a> from the distribution<br />'
.'	<br />'
.'www.ideatoceo.com | 192 allen ave | Saint Louis | MO | 63104 <br  />'
.'</table>';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to_email, $subject, $message, $headers);
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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