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

Just starting out? Need help? Post your questions and find answers here.
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

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

Post 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
QuimV
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

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

Post 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.
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

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

Post 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.
QuimV
Enthusiast
Enthusiast
Posts: 337
Joined: Mon May 29, 2006 11:29 am
Location: BARCELONA - SPAIN

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

Post 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.
QuimV
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

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

Post 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.
miskox
User
User
Posts: 95
Joined: Sun Aug 27, 2017 7:37 pm
Location: Slovenia

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

Post 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
Mathew32
New User
New User
Posts: 2
Joined: Tue Oct 04, 2022 3:14 am

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

Post by Mathew32 »

Oso wrote: Mon Sep 26, 2022 3:41 pm
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 word hurdle

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.
This problem has persisted with my outlook for a while, it makes it more difficult to send mail, even not receive mail, so is there any fix for this problem?
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post by infratec »

If you search for smtp or/and outlook you will find this:

viewtopic.php?p=574875#p574875
Post Reply