Jump to content

WireMailSmtp


horst

Recommended Posts

@chrizz my question was, if you used <head></head><body></body> tags in your HTML-message.

Now I know, you don't. :)

That was the reason why the Signature wasn't attached to the HTML-message-part.
https://github.com/horst-n/WireMailSmtp/blob/532dd94752597a4b2b9f3a2c02ef48b21db77f84/WireMailSmtpAdaptor.php#L280-L285

With the modules update to version 0.2.5, the html-signature get added in both cases.

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

I am experiencing problems when sending through Gmail on a site that is sending out quite a lot of emails to different recipients.

It used to work for about a month and now suddenly Google is blocking my app. It seems that Google regards the app as less secure.

I am wondering if someone has had similar issues with Gmail?

I know there is a setting in Gmail to allow less secure apps. But I would like to know why Google thinks the app is less secure.

Does it have something to do with headers being sent by WireMail that Google disqualifies as insecure? 

Here is the data array from the WireMailSmtp object (sensitive data has been replaced by xxx):
 

default_charset => "UTF-8" (5)
localhost => "dev.xxxtors.com" (31)
smtp_host => "smtp.gmail.com" (14)
smtp_port => 587
smtp_ssl => ""
smtp_start_tls => 1
smtp_user => "info@xxxtors.com" (32)
smtp_password => "xxx" (11)
smtp_password2 => ""
clear_smtp_password => ""
realm => ""
workstation => ""
authentication_mechanism => ""
smtp_debug => 0
smtp_html_debug => 0
sender_name => "xxx" (24)
sender_email => "info@xxxtors.com" (32) 
sender_reply => ""
sender_errors_to => ""
sender_signature => ""
sender_signature_html => ""
send_sender_signature => "1"
extra_headers => ""
valid_recipients => ""
smtp_certificate => ""

And here the mail object data

to => array (2)
"xxx@gmail.com" => "xxx@gmail.com" (26)
"xxx@mailbox.org" => "xxx@mailbox.org" (28)
toName => array (2)
"xxx@gmail.com" => ""
"xxx@mailbox.org" => ""
cc => array ()
ccName => array ()
bcc => array ()
from => "info@xxxtors.com" (32)
fromName => "xxx" (24)
priority => ""
dispositionNotification => ""
subject => "xxx" (51)
body => "This is an automatically created email. Please do not reply.

xxx" (139)
bodyHTML => "xxx" (183)
addSignature => NULL
attachments => array ()
header => array (1)
"X-Mailer" => "ProcessWire/WireMailSmtp" (24)
sendSingle => FALSE
sendBulk => FALSE
useSentLog => FALSE
wrapText => FALSE

Does anyone have an idea why Gmail thinks these mails are less secure?

Link to comment
Share on other sites

8 hours ago, gebeer said:

Does anyone have an idea why Gmail thinks these mails are less secure?

Its because you are storing/sending a Google Account password on your own instead of using a "secure" flow like OAuth2 apps. E.g. using less secure apps is not possible with a 2FA account.

https://support.google.com/accounts/answer/6010255?hl=en

 

Quote

Google may block sign-in attempts from some apps or devices that do not use modern security standards. Since these apps and devices are easier to break into, blocking them helps keep your account safe.

 

  • Like 3
Link to comment
Share on other sites

Oh, google only blocks Thunderbird, Outlook, 60% iOS apps and some more. Yes, of course, the only reason is security for users. ?

@gebeer you may recherche on phpclasses.com, if the smtp class of Manuel Lemos has enhancement for this already. Im totaly behind my time schedules atm. Sorry. 

  • Like 1
Link to comment
Share on other sites

Just now, gebeer said:

Thank you for your suggestions. It is not that many mails, maybe a total of 100 a day and max 10-30 per hour. So I will stay with Gmail for the time being.

That's still a lot for Gmail.  Simply knowing about Gmail's Bulk Sending Guidelines should help you since you want to keep using them.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

@horst Can you tell me how/where in the module this hijacks/extends wireMail()? I'm glad that it does, but I am desperate to understand how this works.

new WireMail();  // WireMail
new wireMail();  // WireMail
wireMail();      // WireMailSmtp
$mail->new();    // WireMailSmtp

This has highlighted one of the many parts of my PW knowledge that is majorly lacking.

 

 

Edit:
Ok. Finally get it. Here's how it works, for anybody else that wonders...

wire/core/boot.php loads JUST WireMailTools. WireMailTools::new() looks for any classes that overlay on WireMail. If WireMailSmtp is installed, it will be the class that is returned.

If none are found, it defaults to WireMail.

Shooooo-wee. Nice to know!

  • Like 2
Link to comment
Share on other sites

Is anyone using this module in combination with SendGrid? I had the module working til a few weeks ago and now I get a time out error that I can't connect to mail.sendgrid.net. Not sure what the exact settings need to be as Sendgrid isn't too clear on this as far as I can find.

Link to comment
Share on other sites

I've no experience with Sendgrid but just in case helpful, I used to use Mandril until they changed their pricing model from reasonable to insane (for small users), at that time I went with Postmark https://postmarkapp.com/ and have had a faultless experience with them for over year over multiple sites (I'm not on a commission ;))

  • Like 1
Link to comment
Share on other sites

12 minutes ago, alan said:

I've no experience with Sendgrid but just in case helpful, I used to use Mandril until they changed their pricing model from reasonable to insane (for small users), at that time I went with Postmark https://postmarkapp.com/ and have had a faultless experience with them for over year over multiple sites (I'm not on a commission ;))

Snap here on the PostMarkApp part. It may have been you who pointed me to them. :)

Do you verify all your individual domains via SPF and DKIM verified authentication?

P

Link to comment
Share on other sites

:) I am sure I have 'bigged' them up before here yes (it was so lovely meeting them after the bottom fell out of Mandrill when then went for DaftPricing™️.

I would like to have individual SPF and DKIM records for each client. A few have asked about why emails though apparently from "noreply at Example Inc." are clearly actually from me@mycorps domain if they reply to one. I've told them all that to save them money the emails come from my DKIM'd and SPF'd email address, but I can do the same for them if they pay for my time setting it up. So far all have said "Oh.., that's why eh? Never mind, leave it as is".

One day I will go tell each of them they must get their records setup, but it's just one of those things that's on the ToDo that's not shouting to be done 'today' ;)

Link to comment
Share on other sites

5 minutes ago, alan said:

:) I am sure I have 'bigged' them up before here yes (it was so lovely meeting them after the bottom fell out of Mandrill when then went for DaftPricing™️.

I would like to have individual SPF and DKIM records for each client. A few have asked about why emails though apparently from "noreply at Example Inc." are clearly actually from me@mycorps domain if they reply to one. I've told them all that to save them money the emails come from my DKIM'd and SPF'd email address, but I can do the same for them if they pay for my time setting it up. So far all have said "Oh.., that's why eh? Never mind, leave it as is".

One day I will go tell each of them they must get their records setup, but it's just one of those things that's on the ToDo that's not shouting to be done 'today' ;)

Good approach. Same here on the authentication etc.

I just verified a single domain - one of my own and send in all responses to clients as "webforms@edenstudios.com". They're pretty ok with that as they recognise them immediately.

 

Link to comment
Share on other sites

That's made me think - I could set up a generic domain, like Campaign Monitor use createsend.com, and send all emails from that. May do that if I need the emails to be more anonymous for any reason ?

  • Like 1
Link to comment
Share on other sites

  • SebastianP changed the title to Strange PHP error in WireMailSmtp: unexpected fully qualified name "\getmessage"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...