Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > EMAILX > EMAILX Scenarios

Simple Plain Text Messages

Scroll Prev Top Next More

This case does not require much elaboration. Just put your message either entirely in the body parameter, either as a text string with CRLF between each line or as a file, or put the header items in the header parameter and the rest of the message in the body parameter. The signature is optional, and if present is treated logically just like a continuation of the message body. No special flags are needed in opflags. Here is an extremely simple example which does not even use on a configuration file:

MAP1 EMAIL’PARAMS

   MAP2 EM’TO,S,200

   MAP2 EM’FROM,S,50

   MAP2 EM’HEADER,S,1000

   MAP2 EM’BODY,S,2000

   MAP2 EM’SERVER,S,20,"mail.king.net"

   MAP2 EM’HOST,S,20,"looseheads.net"

   MAP2 EM’ERRMSG,S,100

   MAP2 CRLF$,S,2

   MAP2 EM’STATUS,F

 

EM’TO = "louisxvi@versailles.gov" + chr(13) + "robespierre@reignofterror.org"

EM’FROM = "marie@foodnet.org"

CRLF$ = chr(13) + chr(10)

EM’HEADER = "To: Louis" + CRLF$ + "From: Marie" + CRLF$ &

   + "Subject: cake recipes"

EM’BODY = "Dear Louis," + CRLF$ &

   + "What is this ‘cake’ I keep hearing so much about?" &

   + CRLF$ + "Je t’aime, Marie"

 

XCALL EMAILX,0,"",EM’TO,EM’HEADER,EM’BODY,EM’STATUS,EM’FROM,"","",EM’ERRMSG,SOCKET,SERVER,HOST

IF EM’STATUS # 0 then print "Error #";EM’STATUS;" – ";EM’ERRMSG