Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
CD-ROM Drive Letter Finder-Using a File
Correct Flashpaper in Director
Button Factory
Shadow Maker
Play Sound of Member
RGB to HSV, HSV to RGB
Drifter
Flash Movie Controls
Tic Tac Toe
Play MPEG with MCI commands
MediaMacros Xtras Mall
 

 

 

Behavior Sending a e-mail with attachment using CDO and VbScriptXtra

Added on 9/17/2002

 

Compatibilities:
behavior D7 D8 D8_5 PC

Required Xtras:
VbScript Xtra

This item has not yet been rated

Author: Eugene Shoustrov (website)

The behavior sends a e-mail message with attached file (if any). It uses Microsoft CDO for Windows 2000 Library. CDO (Collaboration Data Objects) are accessed using VbScriptXtra. To use this behavior replace SMTP server setting to a proper value.

-- Handler uses CDO.Configuration and CDO.Message objects
-- to send e-mail
on SendMail strTo, strText, strFileToAttach
  conf = xtra("VbScriptXtra").CreateObject("CDO.Configuration")
  if stringP(conf) then
    alert conf
    exit
  end if
  conf.fields[conf.cdoSendUsingMethod] = conf.cdoSendUsingPort
  conf.fields[conf.cdoSMTPServer].Value = "smtpServerHere"
  conf.fields.Update()
  
  mes = xtra("VbScriptXtra").CreateObject("CDO.Message")
  mes.Configuration = conf
  mes.To = strTo
  mes.From = "someone@domain.com"
  mes.textBody = strText
  
  --Attaching a file to the message (if any)
  if stringP(strFileToAttach) then
    mes.AddAttachment(strFileToAttach)
  end if
  
  mes.Send()
  if mes.failed then alert mes.LastError
  
  -- Voiding out CDO objects to initiate actual message sending
  mes=void
  conf=void
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail