I'm using PHP 5.2.4 on WinXP and I use Comcast for my email. I have Outlook Express configured to work on the server (right settings, port, etc.), so I can directly send email. The problem is that when I try to use the mail function, I get the error "Warning: mail() [function.mail]: SMTP server response: 550 5.1.0 Authentication required in C:\Inetpub\wwwroot\get_name.php on line 47"; also, mailsend is blank.
The code section is:
...
$cxn = mysqli_connect($host,$user,$password,$dbname)
or die ("Couldn't connect to server.");
$sql = "SELECT UserName FROM User
WHERE email='$email'";
$result = mysqli_query($cxn,$sql)
or die("Couldn't execute email search.");
$num = mysqli_num_rows($result);
if ($num > 0) # email match found in database -
# send User Name
{
$row = mysqli_fetch_assoc($result);
extract($row);
$name = $UserName;
$subj = "Your User Name";
$mess = "Your User Name is ".$name."<br>/n/n Customer Support";
$headers = "bcc:arn02@comcast.net\r\n";
$mailsend = mail($email,$subj,$mess,$headers);
echo "mailsend:".$mailsend."<br>";
}
...
I've tried to use additional parameters in the PHP code, such as:
$name = $UserName;
$subj = "Your User Name";
$mess = "Your User Name is ".$name."<br>/n/n Customer Support";
$headers = "bcc:arn02@comcast.net\r\n";
$addt = "auth_user=myuser02, auth_password=mypassword02";
$mailsend = mail($email,$subj,$mess,$headers,$addt);
but that does not work.
I've also tried to modify the INI file in several ways in the mail section, but that doesn't work either. I use port 587 instead of 25 per Comcast's instructions, and my regular email works with that setting. The latest INI mail section (which includes POP3 parameters since I connect through a POP3 server using Comcast) is:
[mail function]
; For Win32 only.
; CHANGE MADE HERE (both lines)
SMTP = smtp.comcast.net
smtp_port = 587
; For Win32 only.
; CHANGE MADE HERE
sendmail_from = arn02@comcast.net
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
mail.force_extra_parameters =
pop3_server=smtp.comcast.net
pop3_username=myuser02
pop3_password=mypassword02
Any suggestions??