Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.3 mail send issue #20033

Closed
visahardik opened this issue Jan 1, 2019 · 80 comments
Closed

Magento 2.3 mail send issue #20033

visahardik opened this issue Jan 1, 2019 · 80 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@visahardik
Copy link

visahardik commented Jan 1, 2019

Preconditions

  1. Magento 2.3.1 or 2.2.8

Steps to reproduce

  1. Sales > Orders > Open any one order.
  2. Click on Send mail.
  3. Register new customer.

Expected result

  1. Mail should be send

Actual result

  1. main.ERROR: Unable to send mail: Unknown error

Same env works for every mail like register, new order and any other with 2.2.7 or 2.3.0

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Jan 1, 2019

Hi @visahardik. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@visahardik do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 1, 2019
@orlangur
Copy link
Contributor

orlangur commented Jan 1, 2019

@visahardik are you using XAMPP with Linux or MacOS?

You need to debug further what is going wrong on your env, otherwise such issue looks pretty hard to reproduce and investigate by others.

@visahardik
Copy link
Author

@visahardik are you using XAMPP with Linux or MacOS?

You need to debug further what is going wrong on your env, otherwise such issue looks pretty hard to reproduce and investigate by others.

I am using XAMPP with Windows 10. I tried to debug but does not give proper error TranString return files path but not give error.

@ghost ghost self-assigned this Jan 2, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost
Copy link

ghost commented Jan 2, 2019

HI @visahardik thank you for you report, i'm not able to reproduce following steps you described.
This is not a valid environment, please check https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

@ghost ghost closed this as completed Jan 2, 2019
@rvinothraj
Copy link

Hi All,
I am also facing same issue, mail functionality is not working, so i tried debug but cannot able to get respective error expect the following return message.

{"result":false,"message":"Error sending email. We can't process your request right now.","data":"Unable to send mail: Unknown error"}

Before 2.3 upgrade everything was working fine, but after upgrade only got issue because latest version had updates on Transport.php file, ....please try to help someone. Thanks in advance.

@itsazzad
Copy link

itsazzad commented Apr 9, 2019

Same issue using docker

@pixmin
Copy link

pixmin commented Apr 17, 2019

Same issue here, order and invoice emails are not sent anymore after the 2.2.8 and 2.3.1 upgrade.

@orlangur
Copy link
Contributor

@rvinothraj @itsazzad @pixmin this cannot be investigated without a proper debug on your side. Set a breakpoint at line where error is thrown to see what is causing an issue.

Is it correct that you're not using XAMPP?

@pixmin
Copy link

pixmin commented Apr 17, 2019

@orlangur Correct, not using XAMPP (on Debian / Apache)

I have no error message for the order / invoice process, but I'm now going to check if I can reproduce and get more information with the problems reported by @visahardik

@pixmin
Copy link

pixmin commented Apr 17, 2019

@orlangur Sorry but when trying to reproduce, I get no error:

On Magento 2.3.1, go in the back office: Sales > Orders and open an order
Click on "Send email", confirm
I do get the message "You sent the order email." but receive nothing and have no errors in any logs I can think of (console log from the browser, no error in any of the AJAX calls, nothing in any of the log files in var/log, and no error in the Apache logs).

If I switch to 2.3.0 on the very same environment, I get the email...

Would love to help debug this issue, but how?

Note: The issue is exactly the same with Magento 2.2.x (works in 2.2.7 and stopped working on 2.2.8)

@orlangur
Copy link
Contributor

@pixmin,

Set a breakpoint at line where error is thrown to see what is causing an issue.

Please try this. And then check stack trace in runtime to see what is an underlying error.

@orlangur orlangur reopened this Apr 17, 2019
@ghost ghost removed their assignment Apr 17, 2019
@pixmin
Copy link

pixmin commented Apr 17, 2019

@orlangur As I said, I have absolutely no error, at least nowhere I am looking: Browser console and network tab, Apache logs, Magento logs (all log files in var/log: system and debug log files).

@orlangur
Copy link
Contributor

@pixmin it's not about any error in logs. Set xdebug breakpoint at line where such exception is thrown and check stack trace and variable values before it is thrown.

@pixmin
Copy link

pixmin commented Apr 17, 2019

@orlangur

Set xdebug breakpoint at line where such exception is thrown

I have no exception thrown... none.

@orlangur
Copy link
Contributor

@pixmin you need to find a place in code where Error sending email. We can't process your request right now. message is created and set breakpoint there.

Usually this is some exception throwning.

@pixmin
Copy link

pixmin commented Apr 17, 2019

@orlangur Sorry, I might need to create a new issue as I am not having this error. I have absolutely no error anywhere. No indication that there is a problem with email sending except for the fact that I do not receive them...

@ghost ghost self-assigned this Apr 18, 2019
@ghost
Copy link

ghost commented Apr 18, 2019

@pixmin did you have installed 3rd party extension ?

@pixmin
Copy link

pixmin commented Apr 18, 2019

@engcom-backlog-nazar None, it's a fresh install (on both 2.2.8 and 2.3.1)

@ghost
Copy link

ghost commented Apr 18, 2019

@pixmin ok, so this instance installed on local environment or cloud ?

@pixmin
Copy link

pixmin commented Apr 18, 2019

@engcom-backlog-nazar local environment I'm afraid.

But (just in case you missed that part), when I install a 2.2.7 or 2.3.0 on the very same environment, emails just work... I haven't gone through the process of diff'ing both versions to check if anything email-related changed...

@ghost
Copy link

ghost commented Apr 18, 2019

@pixmin can you try send email by php -r "mail('semw_emailAdress@ad.com','theme','body');"

@pixmin
Copy link

pixmin commented Apr 18, 2019

@engcom-backlog-nazar One of the first thing I tried, email goes through instantly... And emails also go through just fine on the same server with both 2.2.7 and 2.3.0...

Thanks for helping me debugging it!

@navaneeth008
Copy link

@nikhil91100 can you try sending mail from server and check if that's sent?

@nikhil91100
Copy link

@navaneeth008 done using mail() function and its successful but no mail received .

@navaneeth008
Copy link

@nikhil91100 so its an issue with server not magento, please check with server support team

@nikhil91100
Copy link

@navaneeth008 ok

@oorobak
Copy link

oorobak commented May 15, 2019

I have the same problem. Have someone this magical commit what repair this issue? Where I can find the solution for it before next release?

@MarcusWolschon
Copy link

Whats the best way to disable the contact form and replace it with an email address?
People are complaining for 2 weeks about the non-working contact form now and rightfully so.

@oorobak
Copy link

oorobak commented May 17, 2019

Ok, I had really stupid mistake. For extra bcc email addresses, what I want to add to each email, I set emails separete by semicolon, not comma (that is mistake). This situation has no error information. And after all the SenderBuilder can't read it properly, and don't send anything. I think that should be protect somehow agaist this situation. Becuase email with order can't go to clients. If it not go to my extra email it's not a problem, but if client can't recaive order it is. And as usually, the configuration can do some people from ecommerce, not from IT, they can do that mistake and not record it.

@nikhil91100
Copy link

Any update ?

@winds1983
Copy link

winds1983 commented May 29, 2019

Same issue in 2.3.1, any update in 2.3.2? could you provide some patch?

@orlangur
Copy link
Contributor

@nikhil91100 @winds1983 what do you mean? Issue is fixed in to-be-released 2.3.2 and 2.3-develop.

@nikhil91100
Copy link

@orlangur ok , thanks

@winds1983
Copy link

winds1983 commented May 30, 2019

@orlangur Thank, I know you have already fix it on 2.3.2, could you send us patch or some fixed file? And when will release 2.3.2?

@orlangur
Copy link
Contributor

@winds1983 it was fixed without link to this issue, so, exact patch should be found by somebody.

I don't know dates for 2.3.2, it is already tested internally for some time (new contributions currently target 2.3.3 already).

@MarcusWolschon
Copy link

2.3.2 is too late. Customers are complaining now. Not in 2 month.
So we need to patch our productive shops with the fix or at the very least have
something we can answer to the complaining customers.

@hostep
Copy link
Contributor

hostep commented May 30, 2019

For the people trying to find out the release date of Magento 2.3.2, it was mentioned on Slack in a public channel by 2 different Magento employees, one said it would be around 26th of June and the other said it would be in the middle of June. So it's not a hard date, but it should be around that period.
And you can always guess, there is a 3 month release schedule, the last release was on the 26th of March. So add 3 months, and voilà :)

@winds1983
Copy link

@orlangur Ok, thanks.

@orlangur
Copy link
Contributor

@MarcusWolschon,

So we need to patch our productive shops with the fix

If it's true, somebody please find an exact patch and post it here.

@loid345
Copy link

loid345 commented Jun 11, 2019

I have the same problem. Where can I find the patch?

@MarcusWolschon
Copy link

MarcusWolschon commented Jun 27, 2019

2.3.2 is released.
While it may or may not have solved the email issue for order emails,
the broken contact-form still does not work.
(Will look if a ticket for that already exits)

@FISHWEB
Copy link

FISHWEB commented Jul 3, 2019

If Magento 2.3.2 is a fresh install, it could be with the server missing the sendmail:

check first if php mail is installed:
php -r "mail('me@myEmail.com', 'Is PHP Mail Setup', 'Yes - I got this email');"
if you get this message:
sh: 1: /usr/sbin/sendmail: not found

then install:
sudo apt-get install sendmail

run this again:
php -r "mail('me@myEmail.com', 'Is PHP Mail Setup', 'Yes - I got this email');"

if it is blank then it should work now.

Try to send from the contact form to see if it works.

@YiffyToys
Copy link

2.3.2 here

  • order status emails working
  • contact form NOT working
  • php mail() command working fine
  • sendmail (of the courier-mta family) is present

@jaredchu
Copy link

jaredchu commented Jul 10, 2019

Email stops working after upgrade to 2.3.2
Magento version: 2.3.2
magento2-mandrill: 3.3.16

@YiffyToys
Copy link

I created #23645 for the remaining issue with the contact form.

@DavidEu000
Copy link

I found it might be the issue of the $parameters of PHP-Mail /vendor/zendframework/zend-mail/src/Transport/Sendmail.php - line 305: $result = mail($to, $subject, $message, $headers, $parameters); When debugging the $parameters that shows: '-f'email@example.com' then it will not send any email out. But if it changed to '-f email@example.com' then I can receive the email.

@YiffyToys
Copy link

YiffyToys commented Aug 30, 2019

I found it might be the issue of the $parameters of PHP-Mail /vendor/zendframework/zend-mail/src/Transport/Sendmail.php - line 305: $result = mail($to, $subject, $message, $headers, $parameters); When debugging the $parameters that shows: '-f'email@example.com' then it will not send any email out. But if it changed to '-f email@example.com' then I can receive the email.

We had a look and experienced the same issue.
However even with the correct -f parameter it would still fail without any error message.
We are using the Courier Mail Server to provide our sendmail implementation.
Using the PHP mail() function with and without a parameters="-f ..." works fine on the command line as the php-user and using the same PHP version and php.ini file as the web browser.

@jaredchu
Copy link

jaredchu commented Sep 2, 2019

This may help people with who has the same env with my site:

@manucorra
Copy link

manucorra commented Sep 17, 2019

We got this issue after upgrade to 2.3. We are running in AWS and sending email vis SES.
The email was not going and there was no error showing in any log files. The mail log also not showing any entry. We tried with a test script and found that mail is sending successfully with 4 arguments in mail().

But on trying with 5 argument('-fsomeone@example.com'), we got below error in console.
[root@ip-111-22-3-444 current]# php /tmp/t.php
More than one "from" person

Thus we debugged the files and found that the 5th argument is the cause for this issue.
/vendor/zendframework/zend-mail/src/Transport/Sendmail.php - line 305

Earlier magento versions was using zendframework1 and the mail function was having only 4 arguments. Thus email is failing when trying to sent it via providers such as SES. To fix this we had added below entry in sendmail configuration in ini files.
sendmail_path = "/usr/sbin/sendmail -t -i -f someone@example.com"

In magento 2.3 new zendframework is using and mail function is having 5 arguments. In this version they have fixed the issue by adding '-fsomeone@example.com' as the 5th argument. This is creating conflict with the fix added in ini files.

By removing the entries in ini files, now email started working from 2.3 instance.

@wushu06
Copy link

wushu06 commented Dec 15, 2019

@manucorra solution worked for me... thanks

@eduardo-g-silva
Copy link

If sendmail isn't installed, install it: sudo apt-get install sendmail
Configure /etc/hosts file: nano /etc/hosts
Make sure the line looks like this: 127.0.0.1 localhost yourhostname
Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
Restart apache sudo service apache2 restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests