• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sendmail -t help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Sendmail -t help (From: Steve Goodman <email@hidden>)

  • Prev by Date: Adding Icons to Scripts
  • Next by Date: Re: Dropping text on to Droplets
  • Previous by thread: Sendmail -t help
  • Next by thread: Adding Icons to Scripts
  • Index(es):
    • Date
    • Thread