Connect PHP to Microsoft Exchange mail

2013 年 7 月 24 日2780

0

Hi,

try ....>>

Open your php.ini file and tell us what are the value assigned to mail directives

[mail function]



we need to see the entire block..

go to code.google.com and search for phpmailer

Back to your server locate which mailer is installed e.g. mercury, etc

In the same level as your php directory find sendmail directory.. in linux this is normally located in the etc directory, but different php application preferences can change the exact location sometimes it is inside the bin directory. YOu just need to know the locations of things in your own server.

in send mail directory find sendmail.ini

load sendmail.ini to gedit or notepad++ find [sendmail] directives

Within the [sendmail] block define

smtp_server=localhost



smtp_port=25



;auth_username=



;auth_password=



change it to something like this..example below uses the smtp.gmail..you can user yahoo, or msn.. the choice is yours..

smtp_server=smtp.gmail.com



smtp_port=587



auth_username= YourAccountUserName@gmail.com



auth_password= YourGmailAccountPassword



Go back to your PHP.ini file and set the mail function directives to this.. it should be the as what we have on the sendmail block.

SMTP = smtp.gmail.com



smtp_port = 587



sendmail_from = YourAccountUserName@gmail.com



Restart your server..

Run your php mailer script..

If you will using the gmail smtp port, make sure you logon to your google email account and click on the red bar confirmation on top of the page, and authorize your server IP to use the smtp OTHERWISE! your server IP is going to be ban by gmail.

If you will be using MSN or Yahoo, make sure you provide the proper smtp port.

0 0