Skip to main content
Setting up SMTP Mailing service Started by Denis M. · · Read 1467 times Denis M. and 5 Guests are viewing this topic. previous topic - next topic

Re: Setting up SMTP Mailing service

Reply #15

Keep your notes, because at some point when it stops working, you'll want to get things configured "correctly" to be sure the problem isn't related to the "misconfiguration" that is "working anyway" at the moment..

// Deep inside every dilemma lies a solution that involves explosives //

Re: Setting up SMTP Mailing service

Reply #16

Quote from: Steeley – Keep your notes, because at some point when it stops working, you'll want to get things configured "correctly" to be sure the problem isn't related to the "misconfiguration" that is "working anyway" at the moment..


Got it ! Thanks for the heads up !  :sweat:

Re: Setting up SMTP Mailing service

Reply #17

Well, my happiness was shortlasting ! @Steeley was right , it doesnt work, now theres a new error but I think it's hosting related , I have no idea how the first mail even went through and how this error just popped up out of nowhere without changing anything in the smtp  :cry:  :cry:  :cry:  :cry:

stream_socket_enable_crypto(): Peer certificate CN=`s7.webhostingsrbija.rs' did not match expected CN=`smtp.sendgrid.net'

This is what Chat GPT has to say:
Understanding the Error
stream_socket_enable_crypto(): This PHP function enables encryption on a stream, typically for securing communications with SSL/TLS.
Peer certificate CN='s7.webhostingsrbija.rs': The Common Name (CN) in the SSL/TLS certificate presented by the SMTP server is s7.webhostingsrbija.rs.
did not match expected CN='smtp.sendgrid.net': The script expects the Common Name to be smtp.sendgrid.net, which means your ElkArte forum is configured to connect to SendGrid’s SMTP server, but the server it’s actually connecting to is presenting a certificate for s7.webhostingsrbija.rs.
Potential Causes
Misconfigured SMTP Settings: Your ElkArte forum might be configured with incorrect SMTP server details.
Man-in-the-Middle (MITM) Attack: While less likely, a MITM attack could be intercepting your SMTP connections and presenting a different certificate.
Proxy or Intermediate Server: Your hosting provider might be routing SMTP connections through an intermediate server which presents its own certificate.

what the heck ?

smtp+Sendgrid+problem+03.jpg


Re: Setting up SMTP Mailing service

Reply #19


If he's using sendgrid as his email server, I don't think that (cpanel smtp filtering thing) is going to help him @ahrasis 

@Denis M. - first, let me ask what is wrong with using your own host's email system (why are you messing with sendgrid at all)?

(FWIW, that error is saying the security certificates are not OAUTH2 (I suspect) security compliant. But, why you are involving ChatGPT in this is beyond me.. let's get back to basic SMTP stuff, which still works in most everywhere, and start there.. )
Last Edit: Today at 12:38:03 am by Steeley

// Deep inside every dilemma lies a solution that involves explosives //

Re: Setting up SMTP Mailing service

Reply #20

Did you read or not? Because the problem (which is mentioned just above the said answer) is exactly the same:
Quote from: https://stackoverflow.com/q/41554028We are attempting to send an autoresponder email to new members. We're using the same configuration on other sites on the same server with no issue. Upon sending the email the following error is returned:

Quotestream_socket_enable_crypto(): Peer certificate CN=cs723.mojohost.com did not match expected CN=smtp.sendgrid.net

Re: Setting up SMTP Mailing service

Reply #21

Quote from: Steeley –
Quote from: ahrasis – Try reading this: https://stackoverflow.com/a/64160785

If he's using sendgrid as his email server, I don't think that (cpanel smtp filtering thing) is going to help him @ahrasis 

@Denis M. - first, let me ask what is wrong with using your own host's email system (why are you messing with sendgrid at all)?

(FWIW, that error is saying the security certificates are not OAUTH2 (I suspect) security compliant. But, why you are involving ChatGPT in this is beyond me.. let's get back to basic SMTP stuff, which still works in most everywhere, and start there.. )


I want to use SendGrid because going through PHP just shoves the email into the spam folder, I need an SMTP setup since my hosting provider only supports registration/login/password reset emails and not ''You have a new reply on your post'' etc then they block your account

Quote from: ahrasis – Did you read or not? Because the problem (which is mentioned just above the said answer) is exactly the same:
Quote from: https://stackoverflow.com/q/41554028We are attempting to send an autoresponder email to new members. We're using the same configuration on other sites on the same server with no issue. Upon sending the email the following error is returned:

Quotestream_socket_enable_crypto(): Peer certificate CN=cs723.mojohost.com did not match expected CN=smtp.sendgrid.net

@Steeley @ahrasis It WORKED !

Just to update everyone that the problem was in the WHM settings (Cpanel) keep in mind I did not have access to those settings and I needed my hosting providers support to disable the ''SMTP Restrictions''

Though the email system is now working although theres a new problem regarding the email templates I will be posting a new topic about the issue

Thanks for all the help and support gentlemen, it means a lot !
Last Edit: Today at 09:20:37 am by Denis M.

 

Re: Setting up SMTP Mailing service

Reply #22

QuoteI needed my hosting providers support to disable the ''SMTP Restrictions''

Ummmm... ok, however, it looks like you are using Sendgrid in addition to your hosts email server, which is redundant - and accomplishes little while doubling your failure exposure ..  since you're still have to have your host do some configuration anyway, right?

QuoteI want to use SendGrid because going through PHP just shoves the email into the spam folder, I need an SMTP setup since my hosting provider only supports registration/login/password reset emails and not ''You have a new reply on your post'' etc then they block your account

OK, now you have cornfused me greatly..

Let's look a little closer and dispel some of that confusion..

When mail is received by your host's email system, it just puts that email in the account incoming mail folder.... 

email.jpg


What happens to those emails after that is strictly up to whatever email processing is done on your end.. be it a client provided by your host ("webmail interface") or your own software client (outlook,  ms mail, Pegasus Mail, etc..) or ElkArte's own software routine, and/or cron jobs. It doesn't automatically just jump into a "spam folder"

If the email is getting pushed into a "spam folder, that is your host's software pre-processing email after it is received. If you have cpanel, then you can disable that for your forum accounts too!  If not, your host certainly can. But most likely, it's whatever YOU are using to look at email that is preprocessing  when you use it, the mailserver just sticks it in the inbound folder.

(If you were to look at one of those files it looks "exactly" like the "raw view" of the email envelope you would see if you selected that view rather than the "prettied up" view of the email you would see that is done by your client, to show you just the sender, subject, date received, and content. The client software decides what to do and how to do it based upon the contents of that email file. ElkArte does it's own thing with email in whatever "folder" it is expecting email to reside in, in exactly the same way.   

The only reason I can see to use Sendgrid is if (a) you're going to be sending massive amounts of bulk emails that your host doesn't want to allow, or (b) your host is not co-operative/responsive to your needs.

If it's the later reason (b), you'll be better off in the long run with a new host.. but it sounds like your host IS responsive ..

QuoteI needed my hosting providers support to disable the ''SMTP Restrictions''
...and apparently he was... right?

I'm a big fan of "KISS" ... the fewer things that can go wrong, will usually result in fewer things going wrong.  Redundancy doubles failure exposure and only improves reliability if the redundancy is in parallel - it sounds like your is serial - that is, incoming mail has to go through SendGrid and then through your host's system. anyway.
Last Edit: Today at 03:37:55 pm by Steeley

// Deep inside every dilemma lies a solution that involves explosives //