I have my web app send myself and sometimes the user an email. All has been working well prior to the server upgrade which happened yesterday. Now the app does not send the emails. The code below is what I have been using. Do I need to change something with this?
dim fwp As New XojoCloud.FirewallPort(465, XojoCloud.FirewallPort.Direction.Outgoing)
fwp.Open()
If fwp.isOpen() Then
dim mail as EmailMessage
dim strMessage as String
Dim MailSocket As New SMTPSecureSocket
MailSocket.Address = "smtp.gmail.com"
MailSocket.Port = 465
MailSocket.ConnectionType = SMTPSecureSocket.TLSv1
MailSocket.SMTPConnectionMode = SMTPSecureSocket.ModeSSLTLS
MailSocket.Secure = True
MailSocket.UserName = app.kMailUN
MailSocket.Password = app.kMailPW
mail = new EmailMessage
mail.fromAddress = "myemail@xxx.com"
mail.subject = "some email subject"
strMessage = "some email message"
mail.bodyPlainText = strMessage
mail.AddRecipient("myemail@xxx.com")
MailSocket.Messages.Add mail
MailSocket.SendMail
fwp.Close() // Close port when done
End If
Jason emailed me privately on this. If anyone else was using a similar code to send emails in an XC web app, the trick after the server upgrade is to remove the
If fwp.isOpen() Then
After removing this, and the End If of course, the app now is sending emails both in debug and deployed to XC
I heard back from Jason this morning saying they fixed the IsOpen. I just tested, and it works, so no need to comment out/remove from your projects if using this line to send emails with an XC web app
Hi Ryan, Iâm glad you posted this or I would have never checked on my own XC apps. As of this moment they are experiencing the same (not working) issue with SMTP - likely opening ports out. Did you need to reboot your server or do anything tricky to get things going after the âfixâ?
I didnât do anything differently. When I spoke with Jason yesterday, I commented out the if fwp.IsOpen line, and then the emails worked. Today, he said they fixed it, so I uncommented the lines today, rebuilt, and all is good. I did not restart the server
Ah, I pushed a new build out, to kill/replace my app and now all seems good. Again, thanks for the heads up - something I need to add to my list to verify after any XC update
@Ryan_Hartz you should tag this thread with âxojo cloudâ as it is a problem specific to xojo cloud
and even reading carefully itâs difficult to understand it applies to XCâŠ
thanks.