Android Question Email Sending Intermittent

Jakes72

Active Member
Licensed User
Longtime User
Hi Experts,

I am trying to send an email using the Net Library like this:

B4X:
Dim Mail As SMTP

Mail.Initialize(strSMTPServerAddress_, "25", strUserName_, strPassword_, "Email")
Mail.UseSSL = False
Mail.AuthMethod = Mail.AUTH_LOGIN
Mail.To.Add(strMailToAddress)
Mail.Subject = "test subject"
Mail.Body = "test message"
Mail.Sender = strSenderEmailAddress_
Mail.Send

Now sometimes it works fine and other times I get a bounce back email sent to me with the following error:
Diagnostic-Code: smtp; 554 5.4.7 [internal] exceeded max time without delivery

Any idea why it works some of the time and not ALL the time??

Regards,
Jacques.
 

Jakes72

Active Member
Licensed User
Longtime User
Hi Erel,

Thank you for the reply.
Yes I am using my own mail server, which I also use for my website and it works great with no problems.

I am also sending a single mail each time.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
you run the mail server; the logs hold the story.
 
Upvote 0

Jakes72

Active Member
Licensed User
Longtime User
Hi Erel,

Thank you for your help, it is appreciated.

The odd thing is why does why my .Net code work fine every time to send a email using the same target server, but not the B4A email code?
We can then surely rule the server out as the issue?
Is there perhaps some kind of internal settings or something you could expose in the Net library to help solve this problem?
Surely I can't be the only one with this problem :(

Regards,
Jacques.
 
Upvote 0

Jakes72

Active Member
Licensed User
Longtime User
Hi drgottjr,

No I don't run the mail server, I am paying a service provider company to host my website and provide me with a mail server at the same time.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I am paying a service provider company to host my website and provide me with a mail server at the same time.
you can contact your provider and ask them for the Server-Log

Maybe start with posting your net code too (you can remove credentials, but please post the ports and settings used.)
 
Upvote 0

Jakes72

Active Member
Licensed User
Longtime User
Eureka!!! Gentlemen I found the problem!
It seems if I use the unqualified version of my Mail Server name, ie. 'mail.somedomain.co.za' as I was instead of the actual IP address then I get this problem!
My website was using the IP address of the server, hence it was working fine! I think it is because my username and the server name are very close??

Thanks guys I appreciate all the help, you pointed me in the right direction! :)
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I have found that this error is usually caused by the "receiving server" (receipient's server) thinking the email is spam and is simply ignoring requests to receive emails to itself.

MANY, MANY factors effect if an email looks like spam.

One thing to check is to make sure BOTH the .MailFrom AND .Sender is the SAME email address that you used in your .net code - see this thread for more info:

 
Upvote 0
Top