Ajay Kumar
Ajay Kumar

Reputation: 1

How to Send mail on localhost using xmapp and wordpress

I have xmapp installed on my system and I am using WordPress for my site. Now in WordPress I have used contact form 7 for the mail purpose and when I send mail from this form it give me error i.e. contact with your system administrator bla bla bla...

I have used wp mail SMTP for this purpose and configure it with site properly

in my sendmail.ini i have set the following :

smtp_server=pop.gmail.com 

smtp_port=587 

smtp_ssl=TLS    

;default_domain=localhost 

auth_username= [email protected]    

auth_password= ------- 

hostname=localhost

and in my php.ini file i have set the following :

;SMTP = 

;smtp_port = 25

; sendmail_from = [email protected]

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path

sendmail_path = "C:\xampp\sendmail\sendmail.exe -t -i"

all I have do to fix it but not getting the result that I want.

in wamp I have done the same settings and able to send mail from my localhost properly and I am happy with that.

Sometimes in xampp the mail send message comes but no mail received in my inbox, can anyone help me in this case

Thank you so much in advance.

Upvotes: 0

Views: 19126

Answers (4)

Khalid Ahmada
Khalid Ahmada

Reputation: 360

This is my snippet based on MailHog you need first to install MailHog and then configure it just need the add the next snippet into your functions.php

https://gist.github.com/khalidahmada/74c3ba52e7d179e323b30d97f4847ec6

Please note that you need the configure your rule that checks if turn on local or not by default rule tests the constant 'WP_HOME' into your wp-config.php if contains 'test' or 'local' either that you need to specify your own role rule the function in the snippet it's isLocal()

Upvotes: 0

mpalencia
mpalencia

Reputation: 6007

Step 1

On your php.ini file ususally found on 'C:\xampp\php'

Edit [mail function]

[mail function]
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Step 2

On your sendmail.ini file ususally found on 'C:\xampp\sendmail'

Edit [sendmail]

[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=yourpassword

Step 3

Restart Apache

Step 4

On your gmail account My Account > Sign-in & security

Switch 'ON' the 'Allow less secure apps'

Upvotes: 0

Kenny Almendral
Kenny Almendral

Reputation: 61

Under sendmail.ini, try changing the smtp_server = pop.gmail.com to smtp_server = smtp.gmail.com

Upvotes: 0

Dipesh KC
Dipesh KC

Reputation: 3297

If you want to send mail from localhost with wordpress and you want to send it with your gmail account then you can use gmail SMTP mail server.

To simplify thing, you can use this plugin

http://wordpress.org/plugins/wp-mail-smtp/

Go to its setting page (Email submenu under the Setting ) and choose following options:

Mailer: send all wordpress emails via SMTP

SMTP Options:
SMTP Host:smtp.gmail.com
SMTP Port:465
Encryption: Yes, use SMTP authentication
Username: **yourfullemail**@gmail.com
Password: **yourgmailpassword**

Upvotes: 2

Related Questions