Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set the 'FROM' aspect of an email message

Status
Not open for further replies.

TerryJones

Programmer
Jul 19, 2000
15
AU
Dear all,<br><br>I have figured out how to email out. I use:<br>&nbsp;&quot;mail($address, $header, $body)&quot;, as shown in PHP manual, at &quot;<A HREF=" TARGET="_new"> a problem occurs with this approach, it states it as being from &quot;HTTP server&quot;. How do I change this so I can state who it is from (eg: FROM &quot;<A HREF="mailto:admin@company.net">admin@company.net</A>&quot;) in the from aspect of the message (not the Header or the body).<br><br>Thank you.<br><br>Yours Sincerely,<br>&nbsp;&nbsp;Terry F. P. Jones
 
Dear all,<br><br>I figured out how to fix this problem. <br><br>I used:<br>&quot;mail($address, $header, $body, $additions)&quot;, as shown in PHP manual, at &quot;<A HREF=" TARGET="_new"> $additions = &quot;FROM &quot;.$emailAddress;<br><br>Thanks all, and have a nice day.<br><br>Yours Sincerely,<br>&nbsp;&nbsp;Terry F. Jones<br><br>
 
A tricky aspect of using the mail() interface is to make sure the $address, $header, and $additions fields contain no extra newline characters. If they do, then a blank line will be inserted in the stream of headers in the email message, terminating the list early and rendering the last few headers ineffective (they're treated as part of the body of the message by recipients).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top