magepal / magento2-gmail-smtp-app

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
https://www.magepal.com
319 stars 147 forks source link

Test Mail Working well usgin the extension but magento 2 is not sending any emails #101

Closed rintish closed 6 years ago

rintish commented 6 years ago

I have Magento version 2.2.0 (Multi-store)

PHP Version 7.0.27 & I have used Zoho SMTP

Test mail is working well but any transanal mail is not sending.

srenon commented 6 years ago

@rintish ... After entering your credential, did you get one or two test email?

rintish commented 6 years ago

@srenon yes, I get 2 test email.

rintish commented 6 years ago

@srenon I try many time manually send email in order section but there is no mail coming in my mail account and I create new user there is no welcome mail comes and forgot password mail not comes

using your extension testing mail working well but all other mail has been not sending

After put username and password clear all cache, re-indexing and crong job working well. all thing try but can't get solution.

srenon commented 6 years ago

This is an issue that I can not reproduce (https://github.com/magepal/magento2-gmail-smtp-app/issues/71), therefore I can not fix it without access to a store with the issue.

What I would recommend

  1. Try to configure the admin testing screen using the same "to" email as one of the orders that not working

  2. Debug by putting a breakpoint at https://github.com/magepal/magento2-gmail-smtp-app/blob/master/Plugin/Mail/TransportPlugin.php#L115 and look at the $smtpConf values to see if they are correct

  3. contact your mail server tech support to see if they are any authentication errors generated by there sever when you try to send an email.

srenon commented 6 years ago

@rintish .... Are you still having issues?

mdivpl commented 6 years ago

Hi! I have the same problem. I'm getting transaction mails with blank FROM field. Of course I have configured E-mails in the shop configuration.

I configured my own SMTP server

srenon commented 6 years ago

@mdivpl ... Are you running single or multi-store?

mdivpl commented 6 years ago

I have: single store, Magento 2.2.3, magento2-gmail-smtp-app 2.5.0.

I noticed that, when I set: "Set From" -> Yes, "Set Reply-to" -> Custom and I write an email in the field "E-mail for reply" than I'm getting the emails with "FROM" mail from "E-mail for reply"

It's looking like problem with getting the fiels from magento settings in regards Shop's emails.

srenon commented 6 years ago

@mdivpl .... you stated that you are having the same issue as the previous user (which is not getting email).... but you also stated that you are getting the email from the reply-to address.

So I'm not 100% sure I understand your issue

mdivpl commented 6 years ago

I made a few tests again and you right, it's not the same problem. Generally sending the emails working, but I'm getting the emails with blank "FROM" information. When I'm sending test email, I'm getting first (1/2) email correct with "FROM" header and second one blank (2/2). Any emails form magento are sending with blank information "FROM:"

Should I open new issue?

srenon commented 6 years ago

Take a look at https://github.com/magepal/magento2-gmail-smtp-app/issues/101#issuecomment-369268885 and check what email is pass to line number 94.

It is possible that your mail server is changing the "from" address (for security reason)

mdivpl commented 6 years ago

I'm sorry, but I'm not good skill in php and magento. Can you explain what you mean about 'admin testing screen'? If you bring how to do it link. I will be grateful. I would like to check this variable.

srenon commented 6 years ago

I'm referring to

image

but if you are not good with Magento/PHP then it may be a little difficult

PeRoland commented 6 years ago

hi i have the same problem magento 2.2.3 magento2-gmail-smtp-app: 2.5

if i test my smtp configuration i got the following error error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /.../vendor/magento/zendframework1/library/Zend/Mail/Protocol/Smtp.php on line 206

but the test email arrives..

if i create an account or place an order i don't get any email. in the logs i can find only the error mentioned. do you have any idea how to solve it?

thx!

srenon commented 6 years ago

@PeRoland... Did you get one or two emails (during testing)?

Your error should have something to do with you SSL cert ... see https://stackoverflow.com/questions/17084886/ssl-error-routinesssl3-get-server-certificatecertificate-verify-failed

PeRoland commented 6 years ago

only one thx for the link, but the certificate is valid, i tested it. but... maybe this is the error. the server starts on port 25 and then changes to starttls.. could this be the error? i tested the smpt also with a local smpt with no certificate an no username. but also in this case i got the same error (strange since there is no ssl/tls)

srenon commented 6 years ago

During testing, you should get 2 emails.

The first one test basic server config using Zend_Smtp The second one test sending email with Magento setting

srenon commented 6 years ago

@PeRoland ... also take a look at https://github.com/magepal/magento2-gmail-smtp-app/issues/59

jpelayo commented 5 years ago

Same problem for me with Magento 2.3.2 + php 7.2 . SMTP works in test mode , but I can't send an invoice, for instance. I removed sendmail to make sure it does not fall back to php mail() . BTW, only the first 1/2 mail arrives. I'm trying Amazon SES.

srenon commented 5 years ago

@jpelayo ... if you having an issue please open a new ticket. Also, all our test environment use of Magento 2.3.1 with PHP7.2.x or Magento 2.3.2 with PHP 7.1.x without any issues. So more than like your issue is caused by something in your environment.

jpelayo commented 5 years ago

Is there any indication I can follow to debug this? There is no trace of the problem in the logs and I can't figure out a starting point.

srenon commented 5 years ago

Enable x-debugger https://github.com/magepal/magento2-gmail-smtp-app/blob/master/Plugin/Mail/TransportPlugin.php#L60 then try resending an order confirmation email

jpelayo commented 5 years ago

For now, I added a debug message to see if it entered:

if ($this->dataHelper->isActive()) { if (method_exists($subject, 'getStoreId')) { \Magento\Framework\App\ObjectManager::getInstance()->get('Psr\Log\LoggerInterface')->debug('MagePal is ACTIVE'); $this->storeModel->setStoreId($subject->getStoreId()); }

And it did: main.DEBUG: MagePal is ACTIVE [] []

Then I took a look at /var/log/maillog and saw that local postfix/smtp was used; postfix/smtp[14059]: CEE4E4A0E4D ... Accepted for delivery

I uninstalled postfix and then

main.ERROR: Unable to send mail: Unknown error [] []

Looks like somehow it was using php Mail() instead of SMTP

srenon commented 5 years ago

@jpelayo.... Base on your previous message I can not tell if your issue is fixed or not, but it more than clear that it is a server config issue and not an extension issue. Let me know if you need some referral to Magento hosting provider that normally have zero issues with our SMTP extension.