Android Question SMTP Save & open email?

tunderin

Member
Licensed User
Longtime User
Hi everybody,

My app sends & receives email using SMTP in the Net library.

Unfortunately, there is no SMTP.save or SMTP.open method, both which I need to implement an outbox for outgoing email that may not be able to reach an SMTP server at time of creation.

Does anybody have a workaround for these missing methods?

Thanks...
 

MotoMusher

Active Member
Licensed User
Longtime User
Nothing straightforward within the net library.

Here's what I do.
I check for network connection of phone or wifi. If no connection, I write the data into a database and use the contents as a queue. I also write email failures into that queue. Easier than tmp saving an email.

I then have a service that runs every 15 minutes and sends everything in the queue.

Dim ph As Phone
Dim myLAN As ServerSocket
If ph.GetDataState <> "CONNECTED" AND myLAN.GetMyIP = "127.0.0.1" Then
'don't send the email, queue
else
'send email
end if
 
Upvote 0

tunderin

Member
Licensed User
Longtime User
Hi MotoMusher,

I had already resigned myself that this would be my answer.

I just posted to the wishlist (link) to add the two methods to SMTP.


Thank you for taking the time to reply...
 
Upvote 0
Top