I would like to change from email_send() to email_send2() so I can include an alias, Cc, and store in outbox.
I have my settings correct in project properties, but I need help with what and where to change below function (which works perfectly)
function emailSendSMTP as c (e as p)
dim cn as sql::Connection
dim flag as l
dim sqlStmt as c
dim rs as sql::ResultSet
dim cntEmail as n = 0
dim pm as P
dim ps as P
flag = cn.open("::Name::MyConnection")
if flag then
sqlStmt = "SELECT email from customers WHERE email <> '';"
flag = cn.Execute(sqlStmt)
if flag then
rs = cn.ResultSet
while rs.NextRow()
if (email_smtp_open(ps, "smtp.emailsrvr.com", 25, "[email protected]", "password"))then
pm.to = rs.data("email")
pm.from = "my_email"
pm.subject = e._currentRowDataNew.subject
pm.html_message = e._currentRowDataNew.messageBody
email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
cntEmail = cntEmail + 1
end while
emailSendSMTP = "emailResult('" + cntEmail + "');"
else
cn.Close()
dim msg as c
msg = "Could not execute the query. Error reported was: " + cn.CallResult.text
msg = js_escape(msg)
dim jscmd as c
jscmd = "alert('" + msg + "');"
emailSendSMTP = jscmd
exit function
end if
else
dim msg as c
msg = "Could not open the connection. Error reported was: " + cn.CallResult.text
msg = js_escape(msg)
dim jscmd as c
jscmd = "alert('" + msg + "');"
emailSendSMTP = jscmd
exit function
end if
cn.FreeResult()
cn.close()
end function
I'm sure this is really simply, but reading the help files are not helping much at my skill level
Thanks
Tony
I have my settings correct in project properties, but I need help with what and where to change below function (which works perfectly)
function emailSendSMTP as c (e as p)
dim cn as sql::Connection
dim flag as l
dim sqlStmt as c
dim rs as sql::ResultSet
dim cntEmail as n = 0
dim pm as P
dim ps as P
flag = cn.open("::Name::MyConnection")
if flag then
sqlStmt = "SELECT email from customers WHERE email <> '';"
flag = cn.Execute(sqlStmt)
if flag then
rs = cn.ResultSet
while rs.NextRow()
if (email_smtp_open(ps, "smtp.emailsrvr.com", 25, "[email protected]", "password"))then
pm.to = rs.data("email")
pm.from = "my_email"
pm.subject = e._currentRowDataNew.subject
pm.html_message = e._currentRowDataNew.messageBody
email_smtp_send(pm, ps)
end if
email_smtp_close(ps)
cntEmail = cntEmail + 1
end while
emailSendSMTP = "emailResult('" + cntEmail + "');"
else
cn.Close()
dim msg as c
msg = "Could not execute the query. Error reported was: " + cn.CallResult.text
msg = js_escape(msg)
dim jscmd as c
jscmd = "alert('" + msg + "');"
emailSendSMTP = jscmd
exit function
end if
else
dim msg as c
msg = "Could not open the connection. Error reported was: " + cn.CallResult.text
msg = js_escape(msg)
dim jscmd as c
jscmd = "alert('" + msg + "');"
emailSendSMTP = jscmd
exit function
end if
cn.FreeResult()
cn.close()
end function
I'm sure this is really simply, but reading the help files are not helping much at my skill level
Thanks
Tony
Comment