WP Mail SMTP Plugin issue with sending mails - wordpress

we have a problem with WP Mail SMTP not being able to send mails.
Environment setup:
We are running on PHP 7.3
Our WordPress instance is actually an Amazon BeansTalk application with load balancer architecture that runs on Amazon Linux 2
SMTP Service : We are using Google SMTP
SMTP Plugin : WP Mail SMTP
Debug when sending a mail via the test mail function of the plugin :
Versions:
WordPress: 5.4.1
WordPress MS: No
PHP: 7.3.16
WP Mail SMTP: 2.1.1
Params:
Mailer: gmail
Constants: No
Client ID/Secret: Yes
Auth Code: Yes
Access Token: Yes
Server:
OpenSSL: OpenSSL 1.0.2k 26 Jan 2017
PHP.allow_url_fopen: Yes
PHP.stream_socket_client(): Yes
PHP.fsockopen(): Yes
PHP.curl_version(): 7.61.1
PHPMailer Debug:
Invalid address: (setFrom) wordpress#

Try with function.php, Add your own code its easiest way. Use wp_mail() function.

Related

Email Sending Issue with CodeIgniter on nginx server

I have shifted my client management system to a new server but after that, emails notifications are not working anymore. The new server is running nginx and this is the error I'm getting in the logs. OpenSSL is updated and installed on the server.
Normal PHPMails are working but they always go to the spam/junk folder so I'm using ZohoMail for this purpose. On the previous apache server, it was running fine.
The same case is happening with WordPress installation as well. Please guide me on this issue so I can better communicate with my server vendor.
ERROR - 2022-04-08 05:12:16 --> Email: sendWithSmtp throwed fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
ERROR - 2022-04-08 05:12:16 --> Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.<br /><pre>Date: Fri, 8 Apr 2022 05:12:16 -0500
From: "Smart Portal" <noreply#email.com>
Return-Path: <noreply#email.com>
To: my#email.com
Subject: =?UTF-8?Q?Test=20message?=
Reply-To: <noreply#email.com>
User-Agent: CodeIgniter
X-Sender: noreply#email.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <62500a803c12f0.84020712#email.com>
Mime-Version: 1.0

Contao > 4.3 sending emails with sendmail throw error on some providers

Older Versions of Contao (till 4.3) working like expected with sending emails via sendmail.
After upgrade to Contao 4.9 I got some errors at Providers like 1u1 / ionos or mittwald.
The error in the logs sound like:
"Expected response code 220 but got an empty response"
Sending Mails from CLI of the Server (means if logged in via SSH) working like expected:sendmail test" |
/usr/sbin/sendmail -t -v -f sender#domain.com reciepient#otherOne.com
The solution is to add this to config/config.yml
swiftmailer:
default_mailer: default
mailers:
default:
url: '%env(MAILER_URL)%'
transport: sendmail
command: '/usr/sbin/sendmail -t -i'
After that, clear the Contao-Cache (e.g. via contao-manager.phar) and give it a try.
The reason for that issue is, that by default the swiftMailer use sendmail -bs as command, which means that sendmail run as standalone Service.
Depending at the way your provider configure it's sendmail, this will be the cause of the error.
If you update symfony/swiftmailer-bundle to version 3.5.0, then the default value used for the sendmail command will be read from the PHP configuration. See https://github.com/symfony/swiftmailer-bundle/pull/302
So provided the PHP configuration of your hosting environment contains the correct command in sendmail_path, sending emails should work without any changes.

MailDev with Symfony 5 Mailer TLS crash

I'm working on my local machine on a Symfony 5 project. To test some mail functionality, I decided to use Node.js MailDev package.
The problem is that I found that MailDev does not support TLS encryption at this moment (version 1.1.0), and I found nothing on Symfony Mailer configuration that's allowed me to disable mail encryption.
When I try to send an email with encryption, MailDev server just crashes.
How can I solve that?
Thanks,
Navalex
Please try:
In .env file: MAILER_DSN=smtp://localhost:1025
Start server: maildev --hide-extensions STARTTLS
if you are using docker try this command
docker run -p 1080:80 -p 1025:25 nameofyourcontainer --web 80 --smtp 25 --hide-extensions STARTTLS

Symfony 4 Swift Mailer doesn't send mails

I´m working in a localhost server with Symfony 4 and FOSUserBundle. I can't manage to receive the email confirmation when a new user is registered.
I have tried the following post but it´s not working in my case:
Symfony 4 SwiftMailer Gmail : Email not sent
I have tried to configure SwiftMailer to send using gmail smtp server and mailtrap smtp server without success. Also I have checked dev.log and no errors are found.
I´m not sure which is the right file to configure Swift Mailer (.env or packages/dev/swiftmailer.yaml). Right now the configuration is the following:
.env file:
MAILER_URL=gmail://***#gmail.com:***#localhost
swiftmailer.yaml:
swiftmailer:
transport: gmail
username: ***#gmail.com
password: ***
host: localhost
port: 465
encryption: ssl
auth-mode: login
spool: { type: 'memory' }
stream_options:
ssl:
allow_self_signed: true
verify_peer: false
verify_peer_name: false
Any ideas? It´s not mandatory to use gmail as the smtp server.
Thanks beforehand.
SOLUTION:
The problem was in the /config/test/fos_user.yaml file:
I changed:
service:
mailer: 'fos_user.mailer.noop'
To:
service:
mailer: 'fos_user.mailer.default'
Documentation: http://symfony.com/doc/master/bundles/FOSUserBundle/emails.html
Also I have accepted less secure connections from the gmail account setting in order to work.
I had the same problem with Symfony 4. My packages version
swiftmailer/swiftmailer v6.1.0
symfony/swiftmailer-bundle v3.2.2
When I used configuration:
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
The emails were not send and no exception occurred.
Then I change the settings into:
swiftmailer:
url: '%env(MAILER_URL)%'
spool:
type: 'file'
path: '%kernel.cache_dir%/swiftmailer/spool'
And tried command:
php bin/console swiftmailer:spool:send --env=dev -vvv
And I saw the error:
[Swift_SwiftException]
No IDN encoder found (install the intl extension or the true/punycode package
So I installed true/punycode package via:
composer req true/punycode
and now emails are sending fine also with spool memory.
Default behaviour of Symfony mailer is to send the email messages immediately, but as you configured, it will "spool" the emails instead of sending them directly.
spool: { type: 'memory' }
Sending the messages from the spool is done separately, with a console command:
php bin/console swiftmailer:spool:send --env=dev
#see more docs here
UPDATE:
As #nek said on the first comment, the the memory spool send the mail immediately (if none exception occured). The spool:send command is only required when using the file spool.

wp-mail-smtp in wordpress Connection refused (111)

I developed my site with WordPress 4.5.3.I installed plugin WP-Mail-SMTP.I create mail account with my host tigrimigri.com.
with this setting
Secure SSL/TLS Settings
Username: Your Email Address
Incoming Server: freehost.tigrimigri.com
IMAP Port: 993
POP3 Port: 995
Outgoing Server: freehost.tigrimigri.com
SMTP Port: 25
Then I write this info at plugin WP-Mail-SMTP setting
But when I test email I get this error
The SMTP debugging output is shown below:
2016-07-02 12:21:04 Connection: opening to ssl://freehost.tigrimigri.com:25, timeout=300, options=array (
)
2016-07-02 12:21:04 SMTP ERROR: Failed to connect to server: Connection refused (111)
2016-07-02 12:21:04 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Please anyone help me.
I think you can not sent mail through freehost.tigrimigri.com
Check the faq section on the site:
http://tigrimigri.com/faq.html
Can I use e-mail?
Sorry it is not possible yet to sent / receive e-mail through our server.

Resources