Sendmail and Xojo 2015r2.4

Hi everybody !

I’ve a problem since using ‘sendmail’ with Xojo 2015r2.4.

When I try this :

dim Socket1 as SMTPSecureSocket socket1=new SMTPSecureSocket socket1.Secure=true Dim mail as EmailMessage Socket1.address ="smtp.gmail.com" Socket1.port = 465 Socket1.username ="xxxxxxxxxx@gmail.com" Socket1.password ="xxxxxxxxxxxxxxx" mail = New EmailMessage mail.subject="Hello" mail.BodyPlainText="Test" mail.headers.appendHeader "X-Mailer","Nexxus" mail.AddRecipient "xxxxxxxxxxxxx@gmail.com" Socket1.messages.append mail Socket1.SendMail

mail is sent and received correctly with Xojo 2014r2 but nothing happens with Xojo 2015r2.4

Someone has an idea of the problem ?

Thanks.

[quote=218551:@Stephane REVILLARD]Hi everybody !

I’ve a problem since using ‘sendmail’ with Xojo 2015r2.4.

When I try this :

dim Socket1 as SMTPSecureSocket socket1=new SMTPSecureSocket socket1.Secure=true Dim mail as EmailMessage Socket1.address ="smtp.gmail.com" Socket1.port = 465 Socket1.username ="xxxxxxxxxx@gmail.com" Socket1.password ="xxxxxxxxxxxxxxx" mail = New EmailMessage mail.subject="Hello" mail.BodyPlainText="Test" mail.headers.appendHeader "X-Mailer","Nexxus" mail.AddRecipient "xxxxxxxxxxxxx@gmail.com" Socket1.messages.append mail Socket1.SendMail

mail is sent and received correctly with Xojo 2014r2 but nothing happens with Xojo 2015r2.4

Someone has an idea of the problem ?

Thanks.[/quote]

Could be the SMTPSecureSocket gets out of scope when the event or method ends.

You may add the Socket1 as SMTPSecureSocket property to the window or webpage, and in your first line, simply do

Socket1 = new SMTPSecureSocket

Hi Michel,

I tried your method but the problem remains the same, it works perfectly with Xojo 2014r2 but not with Xojo 2015r2.4.

SendMail is NOT instantaneous regardless of what the code looks like
IF that code is in the action of a button the n when the event exits the socket is destroyed & the mail may not be sent at all

In gmail I use these settings

the extended sendmail example you can find here

[quote=218551:@Stephane REVILLARD]Hi everybody !

I’ve a problem since using ‘sendmail’ with Xojo 2015r2.4.

When I try this :

dim Socket1 as SMTPSecureSocket socket1=new SMTPSecureSocket socket1.Secure=true Dim mail as EmailMessage Socket1.address ="smtp.gmail.com" Socket1.port = 465 Socket1.username ="xxxxxxxxxx@gmail.com" Socket1.password ="xxxxxxxxxxxxxxx" mail = New EmailMessage mail.subject="Hello" mail.BodyPlainText="Test" mail.headers.appendHeader "X-Mailer","Nexxus" mail.AddRecipient "xxxxxxxxxxxxx@gmail.com" Socket1.messages.append mail Socket1.SendMail

mail is sent and received correctly with Xojo 2014r2 but nothing happens with Xojo 2015r2.4

Someone has an idea of the problem ?

Thanks.[/quote]

Have you tried to change the SSLSocket.ConnectionType ?

Thank you all for your help.

I followed the method of Mike and everything works perfectly now.

The problem was the SSLSocket.ConnectionType that I changed to SSLv3.

Regards.

Remember that SecureSocket might not be secure at all. Looks like SMTPSecureSocket is falling back to insecure if it doesn’t get a certificate, when it should abort with an error.

See https://forum.xojo.com/22855-smtpsecuresocket-encrypted-transfer/0

see also Feedback case 39516.

[quote=219295:@Markus Winter]Remember that SecureSocket might not be secure at all. Looks like SMTPSecureSocket is falling back to insecure if it doesn’t get a certificate, when it should abort with an error.

See https://forum.xojo.com/22855-smtpsecuresocket-encrypted-transfer/0

see also Feedback case 39516.[/quote]

If it works with GMail, it is secure. That smtp simply does not work insecure.