Page 1 of 1

So this has got me perplexed

Posted: Sun Feb 21, 2021 12:21 am
by stevylake
This sends an email just fine

Code: Select all

If CreateMail(1, "no-reply@gmail.com", "Test")
  AddMailRecipient(1, "stevylake@outlook.com",#PB_Mail_To)
  SetMailBody(1, "This is the body")
  SendMail(1, "chi-node59.websitehostserver.net" , 465 , #PB_Mail_UseSSL , "sales@meatcostings.com", "!????????")  
  FreeMail(1)
  MessageRequester("Mail OK","Mail Sent OK")
EndIf
This does suggest that the email has been sent OK but is nowhere to be seen on Outlook, including junk.

Code: Select all

If CreateMail(1, "no-reply@parklanedecor.co.uk", "Test")
  AddMailRecipient(1, "stevylake@outlook.com",#PB_Mail_To)
  SetMailBody(1, "This is the body")
  SendMail(1, "chi-node59.websitehostserver.net" , 465 , #PB_Mail_UseSSL , "sales@meatcostings.com", "!????????")  
  FreeMail(1)
  MessageRequester("Mail OK","Mail Sent OK")
EndIf
If I set the recipient in create mail to any of the well known domains, Gmail, Yahoo, Outlook it works fine. If I set it to my one of my own domains it does not. Is something somewhere thinking it's spam?

Any thoughts would be great!

Re: So this has got me perplexed

Posted: Sun Feb 21, 2021 12:32 am
by infratec
It makes more sense to say it is Ok, when it is Ok :wink:

Code: Select all

If CreateMail(1, "no-reply@gmail.com", "Test")
  AddMailRecipient(1, "stevylake@outlook.com",#PB_Mail_To)
  SetMailBody(1, "This is the body")
  If SendMail(1, "chi-node59.websitehostserver.net" , 465 , #PB_Mail_UseSSL , "sales@meatcostings.com", "!????????")
    MessageRequester("Mail OK","Mail Sent OK")
  Else
    MessageRequester("Mail failed","Mail sent failed")
  EndIf
  FreeMail(1)
EndIf
You should always check the return values.

Are you sure that your server uses the same port and security?

Re: So this has got me perplexed

Posted: Sun Feb 21, 2021 12:38 am
by stevylake
There is no difference in the code except the email address in the AddMailRecipient() procedure.
Anything @gmail.com or @yahoo.com or @outlook.com works wonderfully and I receive the email.
Whack any of my domains in there and the mail gets lost in the ether.
I cannot see where the port or the security would interfere but maybe it does. Does it?

Re: So this has got me perplexed

Posted: Sun Feb 21, 2021 12:49 am
by stevylake
OK. Well thanks to a slight change in the error checking offered by infratec it now seems that the sendmail() procedure is failing and the messages are not being sent with my domains in the Createmail() procedure.

Re: So this has got me perplexed

Posted: Sun Feb 21, 2021 3:31 am
by mk-soft
Some e-mail providers only accept certified e-mail programmes.
With gmail or googlemail, you can adjust the security settings online to accept e-mails from other programmes.

Re: So this has got me perplexed

Posted: Sun Feb 21, 2021 3:49 am
by BarryG
mk-soft wrote:Some e-mail providers only accept certified e-mail programmes.
And some need an app-specific password, and not the usual web password. I had to do that with Gmail.