At 07:31 21/08/2004 -0700, Mark Brownell wrote:

Hi,

I'm trying to get  libSMTP to work for a basic simple email send.

If I use this to add the libraries with the stacks added to my main stack already:

on openStack
  start using stack "libEmail"
  start using stack "libSmtp"
end openStack

on closeStack
  stop using stack "libEmail"
  stop using stack "libSmtp"
end closeStack

Then I need a few lines of code to send email to this destination:
send "ABCDEFG test" to "[EMAIL PROTECTED]" with subject "test send"

or
body = "ABCDEFG test"
destination = "[EMAIL PROTECTED]"
subject  = "test send"

I'm searching for a simple example of using libSmtp to send a plain text email. I can't get the example to work from Shoe Sean's website example. I think it is because I'm not sure how to use adding destinations and saving and/or selecting them during a send. Anyway it crashes on an HTMLtext handler. I'm using Rev 2.2 on Mac OSX. Does anyone have a basic email stack or example of code using these libraries that sends a single email without it being something that looks like it came from the source code of a full blown email client?

Having it report that the email was successfully sent looks like it is part of the lib also.

Here's about the most basic you can get .... and it worked on only my 200th try :-)


on mouseUp
  put "[EMAIL PROTECTED]"&cr into mFrom
  put "[EMAIL PROTECTED]" & lf & "[EMAIL PROTECTED]" & lf into mTo
  put "A simple text message" & cr & "over two lines" into mMessage
  put "smtp.btinternet.com" into mServer
  put "25" into mPort
  put "about to go " after msg
  put libSmtp.send(mFrom, mTo, mMessage, mServer)
  put the result after msg
end mouseUp

Note - LF to separate the recipients

Note - I think I picked up an old version of the library, so you may need to change libSmtp.send to libSmtpSend if you have the later one from the appExample stack

Note - this sends the message to two of my addresses. I did receive both copies; the one that came via the .com address (which forwards it to the .net one) looked OK
Delivered-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Bcc:
Date: Sun, 22 Aug 2004 00:51:55 +0200
X-Provags-Forward: [EMAIL PROTECTED] -> [EMAIL PROTECTED]

A simple text message
over two lines

The one that came "direct" looked bad -
Delivered-To: [EMAIL PROTECTED]


A simple text message over two lines

and it had no "Who" (who from) entry in my Eudora inbox summary.

So you should use libEmail to fill in a more complete message.

-- Alex.
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to