Page 1 of 1

Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Thu Sep 22, 2022 11:14 am
by QuimV
Hello,

Sendmail appears to work correctly when running the following code:

Code: Select all

; From PureBasic Mail example

If CreateMail(0, "user1@triservice.es", "Hello !")

  SetMailBody(0, "Hello !" + #CRLF$ +
                 "This is a multi-" + #CRLF$ +
                 "line mail !")
  
  ; Change the recipients to real one
  ;
  AddMailRecipient(0, "user1@triservice.es", #PB_Mail_To)
  AddMailRecipient(0, "user2@gmail.com", #PB_Mail_Cc)
  
  ; Set the SMTP server to use
  ;
  Result = SendMail(0, "ssl0.ovh.net", 465, #PB_Mail_Asynchronous |  #PB_Mail_UseSSL, "user1", "password1")
  
  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

The result of the execution is "Mail correctly sent !" but, actually, no email reaches the destination.

Am I doing something wrong?

Regards

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Thu Sep 22, 2022 2:49 pm
by Oso
QuimV wrote: Thu Sep 22, 2022 11:14 am The result of the execution is "Mail correctly sent !" but, actually, no email reaches the destination. Am I doing something wrong?
If it's any help to you, your code works fine in my case. Could it be that your SMTP server's security certificate doesn't match the domain? That is quite a common problem and one which I'm unsure how SendMail() would deal with. I hope that doesn't mislead, but I just mention it as it happens to me quite often with shared hosting services.

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Fri Sep 23, 2022 3:14 am
by BarryG
SendMail works fine for me with Gmail. The mail commands are very robust; it's usually the server (and/or its settings) that cause issues.

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Fri Sep 23, 2022 5:31 am
by Rinzwind
Fine with gmail, not working at all with Outlook/Office 365. Has been like that for 2 years of so :evil:

Also connection is not reused, so sending multiple mails is tremendously slooooow.

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Mon Sep 26, 2022 12:59 pm
by QuimV
Hello,

After a few minutes of forwarding a message, I receive in my mail client a message like "Undelivered Mail Returned to Sender".

The body of the message received is as follows:

----

<joaquim.vizcaino@gmail.com>: host gmail-smtp-in.l.google.com[74.125.140.26]
said: 550-5.7.1 [178.33.44.139] Messages missing a valid messageId header
are not 550 5.7.1 accepted.
bp14-20020a5d5a8e000000b002288d5eb570si9552015wrb.1058 - gsmtp (in reply to
end of DATA command)
Reporting-MTA: dns; mo559.mail-out.ovh.net
X-Postfix-Queue-ID: BCA6F211EF
X-Postfix-Sender: rfc822; joaquim.vizcaino@gmail.com
Arrival-Date: Mon, 26 Sep 2022 11:48:41 +0000 (UTC)

Final-Recipient: rfc822; joaquim.vizcaino@gmail.com
Original-Recipient: rfc822;joaquim.vizcaino@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [178.33.44.139] Messages missing a valid
messageId header are not 550 5.7.1 accepted.
bp14-20020a5d5a8e000000b002288d5eb570si9552015wrb.1058 - gsmtp

------

Any ideas?
Should I add a specific header to my message?
Thanks for your help.

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Mon Sep 26, 2022 3:41 pm
by Oso
QuimV wrote: Mon Sep 26, 2022 12:59 pm After a few minutes of forwarding a message, I receive in my mail client a message like "Undelivered Mail Returned to Sender".
It appears from this thread that many Google users are experiencing this recently, and they describe the same as you, but with other mail utilities...

https://support.google.com/mail/thread/ ... ader?hl=en

I see from the example code that you sent last week, a second non-gmail mail address was also specified, but it wasn't clear what your results were with that.

Incidentally, it might be worthwhile removing your email addresses from the sample, because of spammers.

Re: Sendmail works incorrectly on PureBasic 6.00 LTS (W10-64)

Posted: Mon Sep 26, 2022 4:58 pm
by miskox
If this helps: I am sending email from my batch script (.cmd/.bat) successfuly (so they are shown to be sent from gmail - not sure if OP has this problem). But I had to set something like 'enable less secure apps in gmail' - this gave me a special password for my gmail email account.

Saso