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= )
.
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.
Considering one answer in this question, In PHP 4 the PEAR Mail package is typically already installed, and this really simple tutorial shows you the few lines of code that you need to add to your php file http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
These answers are outdated and depreciated. Best practice..
The next on your sendmail.php file just require the following
This can be configure how ever you like..
Use Fake sendmail for Windows to send mail.
sendmail
inC:\wamp\
.sendmail
folder:sendmail.exe
,libeay32.dll
,ssleay32.dll
andsendmail.ini
.C:\wamp\sendmail\sendmail.ini
:The above will work against a Gmail account. And then configure php.ini:
Now, restart Apache, and that is basically all you need to do.
I apply following details on php.ini file. its works fine.
These details are same as on outlook settings.
/etc/postfix/main.cf
to read:/etc/postfix/sasl_passwd
, enter:Type #
/usr/sbin/postmap sasl_passwd
Then run:
service postfix reload
Now PHP will run mail as usual with the
sendmail -t -i
command and Postfix will intercept it and relay it to your SMTP server that you provided.