This solution requires sendmail.exe (a Command Line Interface (CLI)
executable which accepts email from PHP, connects to an SMTP server and
sends email). You will not require to use it by command, don’t bother
about it Download the sendmail.zip and follow these steps:
Step1 : Download the Sendmail.zip file
Step2: Create a folder named “sendmail” in “C:\wamp\”.
Step3: Open the “sendmail.ini” file and configure it as following
Change the Following codes
1. smtp_server = mail.mydomain.com -> smtp_server = smtp.gmail.com
2. smtp_port = 25 - > smtp_port = 465
3. smtp_ssl=auto -> smtp_ssl=ssl
4. ;default_domain=mydomain.com -> default_domain=localhost
(remove the ‘ ;’ in default_domain to enable the code )
5. error_logfile = error.log
6. ;debug_logfile=debug.log -> Remove ; to enable
7. auth_username= [your_gmail_account_username]@gmail.com
auth_password= [your_gmail_account_password]
8. pop3_server=
9. pop3_username=
10. pop3_password=
11. force_sender=
12 .force_recipient=
13. hostname= -> hostname = localhost
Step4:
Enable IMAP Access in your GMail’s Settings -> Forwarding and POP/IMAP -> IMAP Access:
Step5:
Enable “ssl_module” module in Apache server:
Step6:
Enable “php_openssl” and “php_sockets” extensions for PHP compiler:
Step7:
Open php.ini from “C:\wamp\bin\apache\Apache2.2.17\bin” and configure it as following
(The php.ini at “C:\wamp\bin\php\php5.3.x” would not work) (You just need to configure the last line in the following code, prefix semicolon (;) against other lines):
Step1 : Download the Sendmail.zip file
Step2: Create a folder named “sendmail” in “C:\wamp\”.
Step3: Open the “sendmail.ini” file and configure it as following
Change the Following codes
1. smtp_server = mail.mydomain.com -> smtp_server = smtp.gmail.com
2. smtp_port = 25 - > smtp_port = 465
3. smtp_ssl=auto -> smtp_ssl=ssl
4. ;default_domain=mydomain.com -> default_domain=localhost
(remove the ‘ ;’ in default_domain to enable the code )
5. error_logfile = error.log
6. ;debug_logfile=debug.log -> Remove ; to enable
7. auth_username= [your_gmail_account_username]@gmail.com
auth_password= [your_gmail_account_password]
8. pop3_server=
9. pop3_username=
10. pop3_password=
11. force_sender=
12 .force_recipient=
13. hostname= -> hostname = localhost
Step4:
Enable IMAP Access in your GMail’s Settings -> Forwarding and POP/IMAP -> IMAP Access:
Step5:
Enable “ssl_module” module in Apache server:
Step6:
Enable “php_openssl” and “php_sockets” extensions for PHP compiler:
Step7:
Open php.ini from “C:\wamp\bin\apache\Apache2.2.17\bin” and configure it as following
(The php.ini at “C:\wamp\bin\php\php5.3.x” would not work) (You just need to configure the last line in the following code, prefix semicolon (;) against other lines):
[mail function] ; For Win32 only. ; http://php.net/smtp ;SMTP = ; http://php.net/smtp-port ;smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = you@domain.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "C:\wamp\sendmail\sendmail.exe -t -i"
No comments:
Post a Comment