Re: Sendmail -t help
Re: Sendmail -t help
- Subject: Re: Sendmail -t help
- From: Guy Algot <email@hidden>
- Date: Thu, 07 Jun 2001 17:11:03 -0600
On 06/07/2001 03:34 PM, Steve Goodman at email@hidden wrote:
>
What is the correct syntax for getting sendmail -t to include a subject
>
in the email?? I can get it to send but haven't quite figured out the
>
Subject part. The dictionary states:
Here is a handler that I wrote just this morning... Watch out for email
line breaks.
-- script comments
-- Author: Guy Algot
-- Date: 06/07/2001
-- Apps used: none
-- OSAXs used: sendmail -t OSAX
-- Comments:
-- header info does not overwrite 'from' & 'to' data
-- returns true/false
-- set up parameters to pass
-- === update these vars to suit message ===
set theSubject to "subject"
set fromUserEmail to "email@hidden"
set fromUserName to "User Name To"
set toUserEmail to "email@hidden"
set toUserName to "User Name From"
set emailBody to "This is the body of the email"
-- also set the email server to be used
sendMail(theSubject, fromUserEmail, fromUserName, toUserEmail, toUserName,
emailBody)
on sendMail(theSubject, fromUserEmail, fromUserName, toUserEmail,
toUserName, emailBody)
-- === build the email header ===
set theSubjectHeader to "Subject: " & theSubject & return
set fromUserHeader to "From: " & fromUserName & " <" & fromUserEmail &
">" & return
set toUserHeader to "To: " & toUserName & " <" & toUserEmail & ">" &
return
set emailServer to "smtp.domain.com"
set dateString to ((current date) as string) -- in order to use correct
time you must account for GMT
set dateHeader to "Date: " & dateString & return
-- === complete the email and send ===
set emailHeaders to theSubjectHeader & fromUserHeader & toUserHeader &
dateHeader & return & emailBody -- the return is required for Outlook
return send email emailHeaders to toUserEmail from fromUserEmail via
emailServer
end sendMail
=---------------------------------------------------------------=
Guy Algot, mBase Edmonton, Alberta
(780) 945-4605
=---------------------------------------------------------------=
"Microsoft is a cross between the Borg and the Ferengi. Unfortunately,
they use Borg to do their marketing and Ferengi to do their programming."
-- Simon Slavin