Android Question [ Mail Layout ] how can i fix it ?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello eveyrone !

i'm trying send a sample message to my user using smtp server ...

but when i send a " html mail "
gmail's ignore it ...

b4a code >
B4X:
                Dim s As SMTP
                s.Initialize("smtp.domain.com", 587, "mail@domain.com", "xxxxxxxx", "smtp")
                s.StartTLSMode = True
                s.Sender = "mail@domain.com" 'support2 vs support.
                s.Subject = "Welcome aboard capitain !"
                s.HtmlBody = True ' setting html support
                s.Body = $"
                
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <html xmlns="http://www.w3.org/1999/xhtml">
                     <head>
                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
                    </head>
                    
                    <body style="margin: 0; padding: 0;">
                    
                        Welcome aboard capitain .</br></br>
                        
                        Your login details : </br></br>
                        
                        Email : ${usermail}</br>
                        Password : ${userpass}</br>
                        
                    
                    </body>
                    
                    </html>
                
                "$
                
                s.To.Add(usermail)
                s.Send
                Wait For smtp_MessageSent(Success As Boolean)
                Log(Success)

screenshot below >


does anyone know how i can improve the email layout?
 

JohnC

Expert
Licensed User
Longtime User
I would tend to think that gmail is not ignoring your email due to it's format. I think gmail is ignoring your email because it thinks it's spam for some reason.

I translated the middle part of your screen shot and it says "your applicative access data is", but it looks like the full error message was cut off.

Please post an English translation of the full error message so that it might give us ideas of whats going wrong.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…