Hi. I would like some direction on how to send an email to myself from fields in a desktop app without having the user open their email client to send the email. I tried working through the email example in Xojo but am not getting it to work. I made up a dummy gmail account for all the data to be sent from, instead of having the user enter their email client, server, username and password. On the form, I added a TCP Socket and changed the Super to SMTPSocket. Also, I have a textbox to enter the To address and a textarea for the email body. The pushbutton code is below. Is this possible to accomplish? Can you see where I might be going wrong? Are there any settings in gmail I need to change? I already updated the setting in gmail to allow SMTP and disallow POP
[code] dim mail as EmailMessage
MailSocket.Address = “smtp.gmail.com”
MailSocket.Port = 25
MailSocket.Username = “xxxx@gmail.com”
MailSocket.Password = “password”
mail = new EmailMessage
mail.fromAddress = “xxxx@gmail.com”
mail.subject = “testing email”
mail.bodyPlainText = TextArea1.Text
mail.headers.appendHeader “X-Mailer”,“Example SMTP Demo”
mail.AddRecipient trim(TextField1.Text)
MailSocket.Messages.Append mail
MailSocket.SendMail[/code]