<% rem ------------------------------------ rem - Instantiate the SMTP mailer object rem ------------------------------------ Set Mailer = Server.CreateObject("SMTPsvg.Mailer") rem ------------------------------------ rem - Get and print the internal version number rem ------------------------------------ rem strVer = Mailer.Version rem Response.Write "Mailer Version: " + strVer rem ------------------------------------ rem - Set the FromName and FromAddress rem ------------------------------------ Mailer.FromName = "Widgets and More" Mailer.FromAddress = "alvin@xyz.com" rem ------------------------------------ rem - Set the Remote Host (SMTP) Host rem - that we'll send this mail thru rem ------------------------------------ strMailHost = "mailhost.xyz.com" if strMailHost = "mailhost.xyz.com" then Response.Write "

Error: You need to change the mailhost to your SMTP server address

" end if Mailer.RemoteHost = strMailHost rem ------------------------------------ rem - Set the recipient's address rem - that this message will go to rem - rem ------------------------------------ Mailer.AddRecipient "Jay Jones", "anyone@unknownhost.net" rem Mailer.AddRecipient "George Higgins Jr", "georgejr@unknownhost.net" rem ------------------------------------ rem - Set the Carbon Copy addresses rem ------------------------------------ rem Mailer.AddCC "Steve", "anyone@unknownhost.net" rem ------------------------------------ rem - Set the Blind Carbon Copy addresses rem ------------------------------------ rem Mailer.AddBCC "George Higgins", "any1@unknownhost.net" rem ------------------------------------ rem - Set the subject line rem ------------------------------------ Mailer.Subject = "Certified Info" rem ------------------------------------ rem - Set priority and if message is rem - urgent. Prioritys are 1, 3, 5 and rem - are reflected in the X-Priority rem - header rem - 1 = High, 3 = Normal, 5 = Low rem - (optional) rem ------------------------------------ Mailer.Priority = 1 Mailer.Urgent = true rem ------------------------------------ rem - Setup the PGP info rem ------------------------------------ rem PGP should be on your path or you can explicitly specify rem the path in the PGPPath property. Note: You should specify rem the proper PGP parameters such as TZ. Configure PGP properly rem before using this component! Mailer.PGPPath = "pgp.exe" rem The PGPParams property specifies what PGP will do rem to the message file. In the following example we will rem sign the file MYMSG.TXT with a private key belonging to rem anyone@unknownhost.net. The -z parameter allows us to specify the rem passphrase for anyone@unknownhost.net. The -a parameter turns the rem resulting output into ASCII (a requirement for the GetBodyTextFromFile rem method). When testing the PGP parameters you might want to do it from rem a CMD prompt to debug it, and then insert the proper parameters here: Mailer.PGPParams = "-s -a c:\private\mymsg.txt -u anyone@unknownhost.net -z ""my passphrase""" rem ------------------------------------ rem - Load the PGP'd text into the Mailer component rem ------------------------------------ rem GetBodyTextFromFile("FileName", EraseFile (boolean), ShowWindow (boolean)) rem This method will execute PGP (if you've set the PGP parameters up) rem and then load the specified file into the message body text. If EraseFile rem is true then the file is erased once the file is loaded. ShowWindow can rem be set to true for debugging purposes but it is suggested that you turn rem it off once the component has been configured properly. if Mailer.GetBodyTextFromFile("c:\private\mymsg.asc", false, true) then rem ------------------------------------ rem - Send the message rem ------------------------------------ if Mailer.SendMail then Response.Write "

Mail sent..." else Response.Write "

Mail failure. Check mail host server name and tcp/ip connection..." end if else Response.Write "

Error: Failure with encryption or with file access...

" end if %>