Hi, I’ve made and web-app. Now I want to add sending mail. But 2 out of 3 email addresses I’ve tested with fails. Google reports: Sing-in attempt prevented and says my app does not meet modern security standards.
So how to I get this to work. ?? how do I set up the gmails to work… or is it something to be done at the xojo end of my problem ?
code for sending is:
dim myfile as Folderitem = SpecialFolder.UserHome.child(“Downloads”).Child(“test_download.pdf”)
’
dim file as new EmailAttachment
sendMailsocket.connect
sendMailsocket.Secure = TRUE
sendMailsocket.ConnectionType = 2
sendMailsocket.SMTPConnectionMode = 0
SendMailSocket.Port = 465 // Check your server for the property port # to use
SendMailSocket.Address = “smtp.gmail.com” // your SMTP email server
sendMailsocket.Username = “**" // username, full email
sendMailsocket.Password = "” // password
// Create the actual email message
Dim mail As New EmailMessage
mail.FromAddress = “helge.tjelta@gmail.com”
mail.Subject = “Test Email from Xojo”
mail.BodyPlainText = “Hello, World! sendt som shortcut”
mail.Headers.AppendHeader(“X-Mailer”, “Xojo SMTP Example”) // Sample header
mail.AddRecipient(“helgetjelta@me.com”)
file.MIMEType = “application/pdf”
file.loadfromFile(myfile)
'file.loadFromfile(GetFolderItem(myfile.NativePath, folderitem.PathTypeNative))
mail.Attachments.Append file
// Add the message to the SMTPSocket and send it
SendMailSocket.Messages.Append(mail)
SendMailSocket.SendMail