wiki:setup_smtp_in_php_ini_with_authentication
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | wiki:setup_smtp_in_php_ini_with_authentication [2017/10/28 18:45] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Setup SMTP Mail with Authentication in php.ini file on Windows IIS ===== | ||
+ | |||
+ | *Make sure that you install Notepad++ to your windows server because native Notepad Windows app won't work for this. | ||
+ | *On the Windows web server, locate the PHP installation folder. | ||
+ | *Open the php.ini file using Notepad++ editor (right click php.ini and left click "open with" and select Notepad++). | ||
+ | *Search for, add or modify the [mail function] section of php.ini as follows: | ||
+ | |||
+ | < | ||
+ | [mail function] | ||
+ | ; For Win32 only. | ||
+ | ; http:// | ||
+ | ; SMTP = localhost | ||
+ | SMTP = your.mailservername.tld | ||
+ | |||
+ | ; http:// | ||
+ | smtp_port = 25 | ||
+ | |||
+ | ; REMARK - INSERT NEXT TWO LINES TO AUTHENTICATE THROUGH EXISTING EMAIL ACCOUNT ON SMTP SERVER | ||
+ | auth_username = mailuser@yourdomain.tld | ||
+ | auth_password = password_of_your_mailuser | ||
+ | |||
+ | ; For Win32 only. | ||
+ | ; http:// | ||
+ | ; | ||
+ | sendmail_from = no_reply@yourmaildomain.tld | ||
+ | </ | ||
+ | |||
+ | *Save the php.ini file with those changes. | ||
+ | *Restart the World Wide Web service -- Internet Information Services | ||
+ | |||
+ | ==== Create a PHP Test Mailer File ==== | ||
+ | |||
+ | *In some web folder on your php-enabled web site, create a text file named " | ||
+ | *Open that file with Notepad++ and insert the following php code, but change your test recipient' | ||
+ | *Access the file from your website using any web browser. | ||
+ | *Note: The page will be empty, but you should check your recipient email account to see whether the test mail arrived. | ||
+ | |||
+ | < | ||
+ | <?php | ||
+ | //REMARKS -sending email with the php mail() funtion | ||
+ | //REMARKS -THE COMMA-SEPARATED SINGLE-QUOTE ' | ||
+ | //FIELDS - mail(' | ||
+ | mail(' | ||
+ | ?> | ||
+ | </ | ||
+ | ==== Download my example of phpmailtester.php file and modify it accordingly ==== | ||
+ | <file php phpmailtester.php> | ||
+ | <?php | ||
+ | //REMARKS -sending email with the php mail() funtion | ||
+ | //REMARKS -THE COMMA-SEPARATED SINGLE-QUOTE ' | ||
+ | //FIELDS - mail(' | ||
+ | mail(' | ||
+ | ?> | ||
+ | </ | ||
wiki/setup_smtp_in_php_ini_with_authentication.txt · Last modified: 2017/10/28 18:45 by 127.0.0.1