I have a situation that is driving me crazy. I built a small grid that is used by police dispatchers to send short, quick notifications to the police command staff via email and SMS text messages. When I first created it I used the SMTP settings of simple Gmail account that I created specifically for this purpose, and it works perfectly.
But my bosses want me to use a "more professional" Office365 department email address, so I had our vendor create a new account called "[email protected]." I used all of the published SMTP settings for Office365 but it will not send anything. I tried with with the regular password and with an "app password," but still no sending. I also made sure that MFA is turned off, so that shouldn't be an issue.
Plus, I tested the SMTP credentials in Alpha's built-in email program, and it works fine with the Office365 settings, it just won't work when clicking the submit button on the app as part of the AfterInsertRecord function.
Here's the script in the grid which does NOT work:
function AfterInsertRecord as a (e as p)
dim pm as p
dim ps as p
if (email_smtp_open(ps, "smtp.office365.com", 587, "[email protected]", "***********","TLS")) then
pm.to ="[email protected],"
pm.from = "HCPD ALERTS"
pm.Subject = "HCPD Notification"
pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
result = email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
end function
And here is the script that DOES work:
function AfterInsertRecord as a (e as p)
dim pm as p
dim ps as p
if (email_smtp_open(ps, "smtp.gmail.com", 587, "[email protected]","************","TLS")) then
pm.to ="[email protected]"
pm.from = "HCPD ALERTS"
pm.Subject = "HCPD Notification"
pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
result = email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
end function
And as I said, I tested the Office365 settings and creds in Alpha's own email client, and it works fine:
Screen Shot 01-18-22 at 04.38 PM 001.jpg
Screen Shot 01-18-22 at 04.46 PM.jpg
Obviously I have the SMTP settings correct so why won't it send??
But my bosses want me to use a "more professional" Office365 department email address, so I had our vendor create a new account called "[email protected]." I used all of the published SMTP settings for Office365 but it will not send anything. I tried with with the regular password and with an "app password," but still no sending. I also made sure that MFA is turned off, so that shouldn't be an issue.
Plus, I tested the SMTP credentials in Alpha's built-in email program, and it works fine with the Office365 settings, it just won't work when clicking the submit button on the app as part of the AfterInsertRecord function.
Here's the script in the grid which does NOT work:
function AfterInsertRecord as a (e as p)
dim pm as p
dim ps as p
if (email_smtp_open(ps, "smtp.office365.com", 587, "[email protected]", "***********","TLS")) then
pm.to ="[email protected],"
pm.from = "HCPD ALERTS"
pm.Subject = "HCPD Notification"
pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
result = email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
end function
And here is the script that DOES work:
function AfterInsertRecord as a (e as p)
dim pm as p
dim ps as p
if (email_smtp_open(ps, "smtp.gmail.com", 587, "[email protected]","************","TLS")) then
pm.to ="[email protected]"
pm.from = "HCPD ALERTS"
pm.Subject = "HCPD Notification"
pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
result = email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
end function
And as I said, I tested the Office365 settings and creds in Alpha's own email client, and it works fine:
Screen Shot 01-18-22 at 04.38 PM 001.jpg
Screen Shot 01-18-22 at 04.46 PM.jpg
Obviously I have the SMTP settings correct so why won't it send??
Comment