1. --!movie
  2. --!encoding=utf-8
  3.  
  4. --****************************************************************************
  5. -- @file Curl SMTP demo
  6. -- @author Valentin Schmidt
  7. --****************************************************************************
  8.  
  9. global smtp
  10.  
  11. ----------------------------------------
  12. --
  13. ----------------------------------------
  14. on startMovie
  15.     _player.debugPlaybackEnabled = TRUE
  16.  
  17.     smtp = script("smtp").new()
  18.  
  19.     host = "wp227.webpack.hosteurope.de" -- actual smtp host here
  20.     port = 465 -- 465 for SSL, 587 for STARTTLS
  21.     usr = "******" -- actual username here
  22.     pwd = "******" -- actual password here
  23.     smtp.setHost(host, port, usr, pwd)
  24.  
  25.     from = "me@dasdeck.com"
  26.     recipients = "john@domain.com" -- or: recipients = ["john@domain.com", "me@dasdeck.com"]
  27.     subject = "SMTP/SSL with Curl Xtra"
  28.  
  29.     CRLF = numtochar(13) & numtochar(10)
  30.  
  31.     message_plain = ""
  32.     put "Hi John," & CRLF & CRLF after message_plain
  33.     put "this is the plain text part of an email sent with Curl Xtra." & CRLF after message_plain
  34.     put "The email has an attached video file and an inline image." & CRLF & CRLF after message_plain
  35.     put "[image]" & CRLF & CRLF after message_plain
  36.     put "Cheers," & CRLF after message_plain
  37.     put "Valentin" & CRLF after message_plain
  38.  
  39.     message_html = ""
  40.     put "<!DOCTYPE HTML><html lang='en'><head><meta charset='utf-8'></head>" & CRLF after message_html
  41.     put "<body>" & CRLF after message_html
  42.  
  43.     put "<b>Hi John,</b><br><br>" & CRLF after message_html
  44.     put "this is the HTML part of an email sent with Curl Xtra.<br>" & CRLF after message_html
  45.     put "The email has an attached video file and an inline image.<br><br>" & CRLF after message_html
  46.     put "<img src='{{1}}' width='256' height='256' alt='lena'><br><br>" & CRLF after message_html
  47.     put "Cheers,<br>" & CRLF after message_html
  48.     put "Valentin" & CRLF after message_html
  49.  
  50.     put "</body>" & CRLF after message_html
  51.     put "</html>" & CRLF after message_html
  52.  
  53.     files_attached = ["C:\test\bbb_360p_24fps_10sec.mp4"]
  54.     files_inline = ["C:\test\lena_256.jpg"]
  55.  
  56.     res = smtp.sendMail(from, recipients, subject, message_plain, message_html, files_attached, files_inline)
  57.  
  58.     if res = "No error" then
  59.         put "Email sent successfully"
  60.     else
  61.         put "Error sending email: " & res
  62.     end if
  63. end
  64.  
[raw code]