My ISP account requires that I send a username & password for outbound SMTP mail.
How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ).
My ISP account requires that I send a username & password for outbound SMTP mail.
How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ).
PHP mail() command does not support authentication. Your options:
I apply following details on php.ini file. its works fine.
SMTP = smtp.example.com
smtp_port = 25
username = info@example.com
password = yourmailpassord
sendmail_from = info@example.com
These details are same as on outlook settings.
I prefer the PHPMailer tool as it doesn't require PEAR. But either way, you have a misunderstanding: you don't want a PHP-server-wide setting for the SMTP user and password. This should be a per-app (or per-page) setting. If you want to use the same account across different PHP pages, add it to some kind of settings.php file.
After working all day on this, I finally found a solution. Here's how I send from Windows XP with WAMP.
<?php $message = "test message body"; $result = mail('recipient@some-domain.com', 'message subject', $message); echo "result: $result"; ?>
Reference: