Configuring wp_mail function for IIS Server - wordpress

I tried configuring the settings of the IIS Manager and still, it won't work, I have checked the php.ini file of IIS and still no luck.
I also have tried using the WP-Mail-SMTP plugin, still, no luck was found and an error shows up, it looks like this.
"The following From address failed: wordpress#test2 : MAIL FROM command failed,550,The address is not valid."
Where in test2 is the name of the Server.
I am deploying Wordpress at an IIS / Windows Server.
Thanks in Advance.

Create a gmail account then set your smtp settings.
these a few steps have to be follow:
Mailer: SMTP
SMTP Host: smtp.gmail.com
SMTP Port: 465
Encryption: SSL
Authentication: Yes
Username: your full gmail address
Password: your mail password

Related

Sending contact form data from docker container website to host mail server

I have a WordPress website in a Docker container which is running on linux server, the problem is I can't send the contact form data to my email address in the same server. According to my knowledge, WordPress uses mail() php function.
Server informations :
Debian 8
php 5.6
MTA: Postfix (dkim, spf, dmarc, ssl etc. done)
The server is working and sending emails since years, deliverability 10/10.
I am using the Outlook mobile app to access to my e-mails on my phone to this server, which means that the remote access to the SMTP server is working well. (port 587 on tls)
Docker container informations:
Ip address: 172.18.0.1
network mode: Bridge
Interface name: br-61b941dec29d
The website in the container is using WP 6.1.1 and the problem is (I know it's normal) that no emails are sent from the website, neither by clicking on WP reset password link, nor the contact form of the website, which was created with contact form 7 plugin.
Solutions tried:
I tried with a WP plugin that allows to set up external SMTP host, I set up the IP address of the host server, the port 587 and STARTTLS protocol, it did not work, the plugin has a "send test email" button, but at every try the plugin returns an error from the host server:
Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
But since I can configure mobile app to access the SMTP server, and that the certificate (let's encrypt) is valid (I checked with a ssllabs.com) I don't understand this error.
I tried manually by editing the php.ini file in the container which is located at
/usr/local/etc/php/php.ini-production
SMTP = host_ip_address
smtp_port = 587 and then 25
sendmail_from = myaddress#domain.com
I also edited the /etc/postfix/main.cf by adding 172.18.0.0/24 to mynetworks the inet_interfaces was already set to "all"
mynetworks = xxx.xxx.xxx.0/24 [::ffff:127.0.0.0]/104 [::1]/128 172.18.0.0/24
inet_interfaces = all
None of these worked. I tried sending emails with a simple php script using mail() function, it failed with no error log, at least, the logs are not shown in docker logs.
What I'm looking for
Send the data from the contact form to an email address in this host server. It is not mandatory to use internet, since the container and the MTA are on the same host server.

STARTTLS error when sending alerts from Cloudera manager

I'm trying to adjust alerts using Cloudera's Alert publisher (v. 5.14). Here are my alert publisher's settings from Cloudera's UI:
- Enable Email Alerts: true
- Mail Server Protocol: smtp
- Mail Server Hostname: smtp.gmail.com
- Mail Server Username: sender#hadoop-cluster.org
- Mail From Address: sender#hadoop-cluster.org
- Mail Message Recipients: recipient#gmail.com
- Mail Server TCP Port: 587
Any others configs I left by default. Sender's and recipient's emails was obfuscated in this snippet but I can say that "hadoop-cluster.org" is a domain which have a GSuite record so SMTP configs of hadoop-cluster.org should be similar to GMail configs.
When I've applied these settings and restart Cloudera management service I've tried to send test alert. In alert publister's logs I'm catching the following exception:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. p10*****.47 - gsmtp
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1829)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1368)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:886)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:416)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:44)
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
What I'm doing wrong? I've searched the answer on Cloudera's community forums but didn't found any useful advises.
Must issue a STARTTLS command
Enable TLS security by configuring Mail Server Protocol: smtps
Restart cloudera management service and trigger a test email. Don't need to explicitly specify tls port. It will use port 587 by default.
https://developers.google.com/gmail/imap/imap-smtp

How can I receive mail on WordPress with contact 7 and Easy WP SMTP on localhost WAMP?

I installed Contact 7 and Easy WP SMTP plugins on WP locally on WAMP server, but i can't receive mail when i write on contact form.
I use yahoo SMTP host, and have this message when i test mail:
SMTP ERROR: Failed to connect to server:
(0)SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting.
screenshot for Easy WP SMTP
screenshot for Easy Contact 7
this could easily be an authentication problem. Test the credentials using something like this.

How to prevent mail from Wordpress website from being flagged as spam on Exchange online server

I have a website; let's call it abc.com. It's e-mail is handled by Office365. I recently migrated it from a Sharepoint environment to a different webhost (GoDaddy). I have tried using the WP Mail SMTP plugin option to send e-mails, but it fails to send.
My settings are:
smtp: smtp.office365.com
port: 587
encryption: use TLS
authentication: use smtp
Sending fails with the error:
SMTP ERROR: Failed to connect to server: Connection refused (111)
Using the default wp mail with the settings below works to send to e-mail addresses outside the domain, but messages get flagged as spam on addresses within the domain.
header = 'From: '.get_option('blogname').' <wordpress#abc.com>'
I have e-mail routing set to Remote Mail Exchanger. I've tried adding the address wordpress#abc.com to Exchange's allowed list/whitelist, and I even tried adding the host IP to trusted IPs on the server - but it still doesn't work.
As far as I'm aware, GoDaddy do not let you send mail to external SMTP providers. If you're not able to choose another host (which I'd recommend if you can!), you'll need to use wp mail and send all mail to a local address at the same domain, hosted with GoDaddy.
If you wanted to, you could then set up an alias to send it elsewhere.
There's some more background on this over at wordpress.org, such as this thread and this thread.
EDIT
Just realised that the Postman SMTP plugin claims it can get around GoDaddy's filtering using HTTPS:
"Even hosts that block the standard SMTP ports, like GoDaddy or Bluehost, can't stop your email as Postman can deliver via HTTPS if it can't use SMTP."
So maybe give that plugin a go instead. :)
I ended up using the default wp mail.On the client o365 admin I added the email address to the whitelist. Made the mail rule priority over the default spam filter rule.I even went a step further to whitelist the IP but that's overkill I think.

Google Apps SMTP issue on 1and1

I am at my wits end here. I'm trying to set up SMTP settings for use in Wordpress plugin Contact Form 7. My email server is set up through Google Apps and my website is hosted on 1and1. I am using WP plugin Configure SMTP to set it up. After I try to send test email, I get the following error:
SMTP Error: Could not connect to SMTP host.
My SMTP settings are:
SMTP host: smtp.gmail.com
SMTP port: 465
Secure connection: SSL
Auth: yes
SMTP username: my-username#my-domain.com
SMTP password: password
Sender email: my-username#my-domain.com
I have also tried port 587 on TLS and port 25. I have called 1and1 two times, both times they said they don't block ports and cannot help me since my email is pointed to Gmail. I have tried other WP plugins to set up the SMTP settings. I have doublechecked that the MX records that Google supplied me correct in my 1and1 DNS. I have no idea what else I can do, I have read that other have a similar problem with this set up and with others, yet I have not found anything that has solved my issue. Many are saying it is the webhost that is blocking the ports yet 1and1 said both times I called that they don't block ports and it is a Gmail problem. I don't know what else to try.
Any help would be appreciated.
They are not being honest they do block SMTP ports 465 and 587
If you have Domain hosted at 1and1 and configure an email address they miay say they do block..
I have wordpress site attempting to use Contact for 7 and POSTMAN SMTP plugins
Postman has diag routine, it clearly shows that 1and1 are blocking the only mail port open is 443.

Resources