Hi everyone !
I found an example how to send an email and tested it. It works well with Gmail (after messing with the security settings).
However when sending to Hotmail it won't get through. Can anyone provide a working example how you got this to work with Hotmail?
Bonus question: Can you style this by sending HTML format with fonts and colors, multiple lines, if so how to do that?
To find the original post click here
References:
Link to how to use Gmail SMTP server
Link to how to use Hotmail SMTP server
Usage
Code
EDIT:
With help from the community members I put together a little source code example how to send email to anywhere including Hotmail using plain text and an alternative method to send HTML formatted text.
Here's the result as plain text email (to Hotmail)
Here's the result as Html formatted email (To Hotmail of course - what did you expect )
Send an email source code:
v0.3 Plain text only
v0.4 Plain text/HTML formatting (both included as optional)
UPDATE: Available is now also B4Xemail Library. Latest version is v0.4 that corresponds to the source code examples.
This was made using a non-GUI project. It supports both default/html email messages.
You can pre-define your custom html messages or use in-line html code when you pass the message in the parameters.
Hope you find my email library useful ?
I found an example how to send an email and tested it. It works well with Gmail (after messing with the security settings).
However when sending to Hotmail it won't get through. Can anyone provide a working example how you got this to work with Hotmail?
Bonus question: Can you style this by sending HTML format with fonts and colors, multiple lines, if so how to do that?
To find the original post click here
References:
Link to how to use Gmail SMTP server
Link to how to use Hotmail SMTP server
Usage
B4X:
SendMail("My test mail", "Hello from B4X!", "yourmail@hotmail.com")
Code
B4X:
Public Sub SendMail(Subject As String, Body As String, MailTo As String)
SMTP.Initialize("mailserver", portnumber ,"example@hotmail.com" , "password", "smtp")
SMTP.Subject = Subject
SMTP.Body = Body
SMTP.To.Add(MailTo)
SMTP.StartTLSMode = True
SMTP.Send
Wait For SMTP_MessageSent(Success As Boolean)
Log(Success)
If Success Then
Log("Message sent successfully")
Else
Log("Error sending message")
Log(LastException.Message)
End If
End Sub
EDIT:
With help from the community members I put together a little source code example how to send email to anywhere including Hotmail using plain text and an alternative method to send HTML formatted text.
Here's the result as plain text email (to Hotmail)
Here's the result as Html formatted email (To Hotmail of course - what did you expect )
Send an email source code:
v0.3 Plain text only
v0.4 Plain text/HTML formatting (both included as optional)
UPDATE: Available is now also B4Xemail Library. Latest version is v0.4 that corresponds to the source code examples.
This was made using a non-GUI project. It supports both default/html email messages.
You can pre-define your custom html messages or use in-line html code when you pass the message in the parameters.
Hope you find my email library useful ?
Attachments
Last edited: