[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: Richard Applebaum: [MacPerl] Sendind Email from a CGI



At 04.27 12/15/97, Matthias Ulrich Neeracher wrote:
>In the proprietary system I can send email with the following "format"
>statement:
>
>format email to $UsersEmailAddr from myname@mydomain.com subject "Online
>Order" name $UserName;
>
>
>Your order has been entered as follows:
>
>     DATE:  $original_date     TIME: $original_time
>
>  SOLD TO:  $SoNa
>  ADDRESS:  $SoAd
>     CITY:  $SoCi, $SoSt   $SoZi
>    PHONE:  $SoPh
>    EMAIL:  $SoEm
>
>.   <---- Trailing period
>
>Everything between the format statement and the trailing period is a
>"picture" of how the email is to look (with substitution of the values
>for $ variables).

For that, you want to use formats.  There is a man page all about formats
under your MacPerl help menu.  Basically, something like this:

format MAIL =
Your order has been entered as follows:

     DATE:  @<<<<<<<<<<<<<     TIME: @<<<<<<<<<<<<<
$orignal_date, $original_time

  SOLD TO:  @<<<<<<<<<<<<<<<<<<<<<<<<
$SoNa
  ADDRESS:  @<<<<<<<<<<<<<<<<<<<<<<<<
$SoAd
     CITY:  @<<<<<<<<<<, @<<<<<<< @<<<<<
$SoCi, $SoSt, $SoZi
    PHONE:  @<<<<<<<<<<<<
$SoPh
    EMAIL:  @<<<<<<<<<<<<<<<<<<<<<<<
$SoEm

.



>Is there a way to send email from within a MacPerl CGI?

Check out the libnet distribution that comes with MacPerl 5.1.5r4.
Net::SMTP.  Also look at Mailtools on Paul Schinder's site:

        ftp://mors.gsfc.nasa.gov/pub/MacPerl/Scripts/

I have a forthcoming chapter for review on network programming, and it
covers how to do this somewhat.  It will be at
http://www.ptf.com/macperl/ptf_book/draft.html soon.  Remember to give us
feedback when you have read it!

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch