Hi, i just tried updating my version to 2015r4 and it broke my emailing piece. i have traced every possible method and no errors are being returned yet the email will not send.
Also once the email states that it was “sent” it tried to reopen the window and throws an out of bounds exception, since the window is already open. but nowhere in my code is it referring to the window open event.
Check what secure setting you’re using
Most providers require something newer than what I suspect your code defaults to
Thats the most common cause of this
i found the issue it is with the Send Email method of the SMTPSecureSocket. I havnt figured out why it is changing the port or how to keep it from changing but that is the issue.
Default values, values set by the IDE, and values set by your code can all argue with each other.
Secure port is 465 by the way.
how do i go about setting the port default value?
this is working for me with 1&1 and Domainfactory Servers, replace capitilized placeholders…
dim smtphost as new SMTPSecureSocket
dim mail as new EmailMessage
smtphost.Address = YOURSMTPSERVER
smtphost.Port = 465
smtphost.Secure = True
smtphost.ConnectionType = SMTPSecureSocket.SSLv23
smtphost.Username = YOURSUERNAME
smtphost.Password = YOURPW
mail.FromAddress = YOUREMAIL
mail.Subject = YOURSUBJECT
mail.BodyPlainText = YOURMESSAGE
i pasted in your code and compiled it with the information i need and it still hijacked the port
Hi James, what do you mean with “hijacked”… do you have any blocking firewall? Does the SMTP server respond? Hard to say without any further information.
I think the port is a red herring. It is normal for the port to change after the socket connects.
the issue is with the change that xojo made to the SMTPSecureSocket. in 2015r3.1 i have it sending to firstname.lastname@example.org with password on port 25 to email@example.com. using the port 25 is causing the problems so i had to change it to port 587 now everything works.
As far as what i meant by hijacking: when i was tracing my code my port was set to 25 all the way through. once the .sendmail method was called the port would change to a 4 digit number (typically about 4500 and below 5500) and this is what i thought the issue was, was that the port wasnt holding. now i see that the issue is that the port is not being authenticated and the SMTPSecureSocket requires authentication. which 587 supports authentication. 25 is a relay port.
Neither 25 nor 587 are the correct ports for the secure socket.
According to this article by mailgun:
This is the default mail submission port. When a mail client or server is submitting an email to be routed by a proper mail server, it should always use this port.
Is this wrong?
No, you are correct. Thanks for the info. One learns something new every day.