sscotti
asked on
PHP e-mail Headers, etc.
Had a question about sending e-mail with the PHP mail function (or SMTP):
I have a site that I am working on that has a function like this:
function enviar_correo($fromname, $fromaddress, $toname, $toaddress, $bcc ,$subject, $message)
{
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
$headers .= "Bcc: \"".$bcc."\"";
return mail($toaddress, $subject, $message, $headers);
//return 1;
}
Sorry for the Spanish
It seems to be working correctly except for the from and bcc headers. It isn't sending the $fromname in the e-mail, and it isn't sending the bcc e-mail at all. I've tried quite a few changes and I'm having trouble with that. Also is there a way to send via smtp from PHP and how is that done.
I have a site that I am working on that has a function like this:
function enviar_correo($fromname, $fromaddress, $toname, $toaddress, $bcc ,$subject, $message)
{
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
$headers .= "Bcc: \"".$bcc."\"";
return mail($toaddress, $subject, $message, $headers);
//return 1;
}
Sorry for the Spanish
It seems to be working correctly except for the from and bcc headers. It isn't sending the $fromname in the e-mail, and it isn't sending the bcc e-mail at all. I've tried quite a few changes and I'm having trouble with that. Also is there a way to send via smtp from PHP and how is that done.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.