Page 1 of 1

SENDMAIL SSL or TLS is not OK

Posted: Tue Mar 21, 2023 5:07 pm
by al2791
Windows 11 PRO
Pb 6.01

I can't sent the mail 1) or 2)

Code: Select all

Mail_From$="xxx@gmail.com"
Mail_Pass$="*****"
Mail_To$="yyy@gmail.com"

If CreateMail(0, Mail_From$, "Hello")
    AddMailRecipient(0, Mail_To$, #PB_Mail_To)

     ; 1) ; Result = SendMail(0, "smtp.gmail.com", 465, #PB_Mail_UseSSL, Mail_From$, Mail_Pass$)
     ; or 2) ; 
    Result = SendMail(0, "smtp.gmail.com", 587, #PB_Mail_UseSMTPS, Mail_From$, Mail_Pass$)
     
   Repeat
    Progress = MailProgress(0)
    Delay(300)
   Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
  
  If Progress = #PB_Mail_Finished
    MessageRequester("Information", "Mail correctly sent !")
  Else
    MessageRequester("Error", "Can't sent the mail !")
  EndIf   
EndIf

With parameters of Thunderbird, to send mail is OK
Server=smtp.gmail.com
Port=465
Sécurité de la connexion =SSL/TSL
Méthode d'authentification = OAuth2
Nom utilisateur=xxx@gmail.com

Do you know where is the proberm ?
Thank's

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Mar 21, 2023 6:07 pm
by hoerbie
From my understanding #PB_Mail_UseSMTPS should be used on port 465 and #PB_Mail_UseSSL on port 587 or 25.

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Mar 21, 2023 7:55 pm
by mk-soft
You must also allow non-certified mail programs (such as your own APP) to send e-mails in the GMAIL settings (Online). Otherwise your mail will be rejected.

Re: SENDMAIL SSL or TLS is not OK

Posted: Wed Mar 22, 2023 12:12 am
by BarryG
Yep, port 587 for Gmail with SSL now. It used to be port 465, but Gmail changed it, so I had to change my port to match.

Re: SENDMAIL SSL or TLS is not OK

Posted: Wed Mar 29, 2023 12:05 pm
by al2791
I set up the gmail account :
- Enable two-step verification
- Generate application password.

Thanks for your help

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 4:50 am
by ricardo
mk-soft wrote: Tue Mar 21, 2023 7:55 pm You must also allow non-certified mail programs (such as your own APP) to send e-mails in the GMAIL settings (Online). Otherwise your mail will be rejected.

Hi,

I don't find this option

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 8:24 am
by BarryG
ricardo wrote: Tue Apr 11, 2023 4:50 amI don't find this option
Read this -> https://support.google.com/mail/answer/185833?hl=en

It's what I had to do for my apps to send mail with Gmail.

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 1:47 pm
by ricardo
BarryG wrote: Tue Apr 11, 2023 8:24 am
ricardo wrote: Tue Apr 11, 2023 4:50 amI don't find this option
Read this -> https://support.google.com/mail/answer/185833?hl=en

It's what I had to do for my apps to send mail with Gmail.
Thanks.


But it works sending emails from some domain .com

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 2:00 pm
by mk-soft
ricardo wrote: Tue Apr 11, 2023 1:47 pm But it works sending emails from some domain .com
The point is to send a mail. To do this, you have to log on to the mail server.

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 7:53 pm
by ricardo
mk-soft wrote: Tue Apr 11, 2023 2:00 pm
ricardo wrote: Tue Apr 11, 2023 1:47 pm But it works sending emails from some domain .com
The point is to send a mail. To do this, you have to log on to the mail server.
Hi,

I do that, but does not use gmail, but one domain that i own. I create an email account and test this and it works perfectly, i even sent an attachment.

Re: SENDMAIL SSL or TLS is not OK

Posted: Tue Apr 11, 2023 8:21 pm
by mk-soft
The security requirements are higher with gmail (which I also find good).
- You must have an app passport
- You must activate "imap access" under gmail settings (access Gmail with IMAP via other applications).
There you will also find the necessary settings for access.

I don't know what these settings look like in English (German here).
But I think it's good that non-certified mail programs don't have access to my account.