sending email

Monte Goulding monte at sweattechnologies.com
Sat Nov 9 19:30:01 EST 2002


Heres the script that I use to abstract from the libSMTP API. Watch for
wrapping:

on sendmail pText, pAttachment, pTo, pFrom, pSubject, pSMTP
  put url "http://www.google.com/" into tHome
  if tHome is "" then
    answer error "Could not contact server! Please check your internet
connection and try again." titled "Could not contact server."
    exit to top
  end if
  libSMTP_initialize
  libSMTP_serverInfo pSMTP
  libSMTP_mailFrom item 1 of pFrom , item 2 of pFrom
  repeat for each line strRecipientListLine in pTo
    if the number of items of pTo > 1 then
      libSMTP_recipient item 1 of strRecipientListLine, item 2 of
strRecipientListLine
    else
      libSMTP_recipient item 1 of strRecipientListLine
    end if
  end repeat
  repeat for each line strAttachmentListLine in pAttachment
    libSMTP_attachment strAttachmentListLine
  end repeat
  libSMTP_messageSubject pSubject
  libSMTP_messageBodyText pText
  libSMTP_mailerInfo "Revolution SMTP Socket v1.0.0 (2002.05.27.2)"
  put libSMTP_send() into tSuccess
  if tSuccess <> "" then
	answer error tSuccess
  end if
end sendmail

Cheers Monte




More information about the use-livecode mailing list