LC server, tsNetSmtpSync, mimeEncode and ignorance
Posted: Fri Apr 10, 2020 5:55 pm
Hi,
I'm trying to send an email via SMTP on the LC hosting server via a simple .lc script. The script is below, but the server chokes on the "mimeEncode..." command: it doesn't know what to do with it. What am I missing?
<?lc
put "[correct username]" into tSettings["username"]
put "[correctPW]" into tSettings["password"]
put "This Should be my content" into tBody
put "[oneEmailAddress]" into tSender
put "[AnotherEmailAddress]" into tRecipient
put "Should be my subject line" into tSubject
put "[correctServerAndPortNumber]" into tUrl
mimeEncodeAsMIMEEmail tBody, "[oneEmailAddress]", "[AnotherEmailAddress]", , "My Subject Line"
tsNetInit
put tsNetSmtpSync(tURL, tSender, tRecipient, it, tResponseHeaders, tBytes, tSettings) into tResult
if the first word of tResult is "tsneterr:" then
put "Error" && tResult
else
put "E-mail sent"
end if
?>
I'm trying to send an email via SMTP on the LC hosting server via a simple .lc script. The script is below, but the server chokes on the "mimeEncode..." command: it doesn't know what to do with it. What am I missing?
<?lc
put "[correct username]" into tSettings["username"]
put "[correctPW]" into tSettings["password"]
put "This Should be my content" into tBody
put "[oneEmailAddress]" into tSender
put "[AnotherEmailAddress]" into tRecipient
put "Should be my subject line" into tSubject
put "[correctServerAndPortNumber]" into tUrl
mimeEncodeAsMIMEEmail tBody, "[oneEmailAddress]", "[AnotherEmailAddress]", , "My Subject Line"
tsNetInit
put tsNetSmtpSync(tURL, tSender, tRecipient, it, tResponseHeaders, tBytes, tSettings) into tResult
if the first word of tResult is "tsneterr:" then
put "Error" && tResult
else
put "E-mail sent"
end if
?>