View Full Version : PHP mail() function
DAMAN
04-13-2004, 03:35 AM
I am new to PHP scripting and using my website to test on a live website before production.
Is the server's php.ini file setup this way:
SMTP = mail.yourdomainname.com (i.e. charlotte.com)
sendmail_from = chosenalias</font id="red">@yourdomainname.com
TIA
bruce
04-13-2004, 10:27 AM
The SMTP server is set in the INI file.
The send from is phpmailer@discountasp.net
[b]quote:Originally posted by DAMAN
I am new to PHP scripting and using my website to test on a live website before production.
Is the server's php.ini file setup this way:
SMTP = mail.yourdomainname.com (i.e. charlotte.com)
sendmail_from = chosenalias</font id="red">@yourdomainname.com
TIA
</blockquote id="quote"></font id="quote">
bruce
04-13-2004, 10:29 AM
You can change the from address by adding a customized header
<?php
$to = "someone@test.com";
$subject = "Test Mail from PHP";
$out = str_pad("This is a test", 20);
$header = "From: chosenalias@yourdomainname.com\nReturn-Path: chosenalias@yourdomainname.com\nX-Mailer: PHP/" . phpversion();
mail($to, $subject, $out, $header);
exit;
?>
[b]quote:Originally posted by bruce
The SMTP server is set in the INI file.
The send from is phpmailer@discountasp.net
[b]quote:Originally posted by DAMAN
I am new to PHP scripting and using my website to test on a live website before production.
Is the server's php.ini file setup this way:
SMTP = mail.yourdomainname.com (i.e. charlotte.com)
sendmail_from = chosenalias</font id="red">@yourdomainname.com
TIA
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
DAMAN
04-14-2004, 01:16 AM
Thanks Bruce!
vBulletin® ©Jelsoft Enterprises Ltd.