So this has got me perplexed

Just starting out? Need help? Post your questions and find answers here.
stevylake
User
User
Posts: 24
Joined: Fri Apr 05, 2019 6:50 pm

So this has got me perplexed

Post 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!
infratec
Always Here
Always Here
Posts: 7583
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: So this has got me perplexed

Post 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?
stevylake
User
User
Posts: 24
Joined: Fri Apr 05, 2019 6:50 pm

Re: So this has got me perplexed

Post 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?
stevylake
User
User
Posts: 24
Joined: Fri Apr 05, 2019 6:50 pm

Re: So this has got me perplexed

Post 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.
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: So this has got me perplexed

Post 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.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
BarryG
Addict
Addict
Posts: 4130
Joined: Thu Apr 18, 2019 8:17 am

Re: So this has got me perplexed

Post 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.
Post Reply