Support forumCategory: QuestionsIssue sending mail via cancellation/approve link
Attila asked 4 weeks ago

I have issues sending out mail after using the cancellation/approval link in e-mails. Sending out test mail (both normal and native) is working fine. Also the mails to the customer and Admin goes out well after registering the appointment. But sending mails via the links fail with an entry in the error log:TYPE: MAILERRORS: {“wp_mail_failed”:[“SMTP Error: Could not authenticate.”]} I’m using WP Mail SMTP plugin and the SMTP service of my hosting provider. Please help me to find the way out. I also tried to switch off sending by SMTP in the WP Mail SMTP plugin and then it works fine. However obviously I would prefer to use SMTP also in the future. Thank you in advance,Attila

5 Answers
Nikola Loncar Staff answered 4 weeks ago

HI Attila, mail notification after user clicks on link is the same as booking appointments. There should be no difference between those two. Can you please check user/pass settings for SMTP plugin?

Best regards,
Nikola

titala replied 4 weeks ago

Hi Nikola,
This is very strange. There must be a difference somewhere. I just figured out the solution/workaround. For WP Mail SMTP you can set up the SMTP password also in the wp-config.php because of security reasons. The mail via link is not working in this case. However if you specify the password in the WP Mail SMTP setup then it works without any problem.
Best regards,
Attila

titala answered 3 weeks ago

Hi Nikola,
The solution direction has been explained by WP Mail SMTP support: https://wordpress.org/support/topic/hide-password-in-wp-config-blocks-sending/
Based on that I believe at the moment only you can resolve the issue. Hope it is coming soon.
Regards,
Attila

Nikola Loncar Staff answered 3 weeks ago

Hi Attila, I have check that thread. There it is saying that you need to define Consts for those access data should be defined at right place. If that is not the case it will not be loaded. Have you put it inside wp-config.php?

Best regards,
Nikola

titala answered 3 weeks ago

Dear Nikola,
The constant is definitely defined. In general the mail sending is working fine.
I mean the second part of their answer  “it might be because the constants for the password aren’t yet defined at the time of sending the emails. Please make sure the constants are added correctly and defined when the emails are sent.” Since the issue only happens in the case the mail sending triggered by cancel/approve link, I believe the constant is not defined yet at the time of mail sending. With other words the mail is sent too early or without letting the opportunity to define the constant coming from the wp-config.php.
Regards,
Attila

Nikola Loncar Staff replied 3 weeks ago

Hi Attila, I will have to test this and let you know. I will define some variable and access it during email trigger from link.

Best regards,
Nikola

titala replied 3 weeks ago

Thx for your efforts!

titala answered 1 week ago

Hi Nikola, Any news concerning this?