--!movie
--!encoding=utf-8
--****************************************************************************
-- @file Curl SMTP demo
-- @author Valentin Schmidt
--****************************************************************************
global smtp
----------------------------------------
--
----------------------------------------
on startMovie
_player.debugPlaybackEnabled = TRUE
smtp = script("smtp").new()
host = "wp227.webpack.hosteurope.de" -- actual smtp host here
port = 465 -- 465 for SSL, 587 for STARTTLS
usr = "******" -- actual username here
pwd = "******" -- actual password here
smtp.setHost(host, port, usr, pwd)
from = "me@dasdeck.com"
recipients = "john@domain.com" -- or: recipients = ["john@domain.com", "me@dasdeck.com"]
subject = "SMTP/SSL with Curl Xtra"
CRLF = numtochar(13) & numtochar(10)
message_plain = ""
put "Hi John," & CRLF & CRLF after message_plain
put "this is the plain text part of an email sent with Curl Xtra." & CRLF after message_plain
put "The email has an attached video file and an inline image." & CRLF & CRLF after message_plain
put "[image]" & CRLF & CRLF after message_plain
put "Cheers," & CRLF after message_plain
put "Valentin" & CRLF after message_plain
message_html = ""
put "<!DOCTYPE HTML><html lang='en'><head><meta charset='utf-8'></head>" & CRLF after message_html
put "<body>" & CRLF after message_html
put "<b>Hi John,</b><br><br>" & CRLF after message_html
put "this is the HTML part of an email sent with Curl Xtra.<br>" & CRLF after message_html
put "The email has an attached video file and an inline image.<br><br>" & CRLF after message_html
put "<img src='{{1}}' width='256' height='256' alt='lena'><br><br>" & CRLF after message_html
put "Cheers,<br>" & CRLF after message_html
put "Valentin" & CRLF after message_html
put "</body>" & CRLF after message_html
put "</html>" & CRLF after message_html
files_attached = ["C:\test\bbb_360p_24fps_10sec.mp4"]
files_inline = ["C:\test\lena_256.jpg"]
res = smtp.sendMail(from, recipients, subject, message_plain, message_html, files_attached, files_inline)
if res = "No error" then
put "Email sent successfully"
else
put "Error sending email: " & res
end if
end