Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Email to Sent Items

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have some code which sends an email through VBScript:
Code:
  'create the email components, attach the zip file etc and send 
  strSchema = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/"[/URL]
  Set objConfig= CreateObject( "CDO.Configuration" )
  With objConfig
    .Fields.Item( strSchema & "smtpserver" ) = strEmailServer
    .Fields.Item( strSchema & "smtpserverport" ) = 25
    .Fields.Item( strSchema & "smtpconnectiontimeout" ) = 10
    .Fields.Item( strSchema & "smtpauthenticate" ) = 1
    .Fields.Item( strSchema & "sendusing" ) = 2
    .Fields.Item( strSchema & "sendusername" ) = strEmailUsername
    .Fields.Item( strSchema & "sendpassword" ) = strEmailPassword
    .Fields.Update
  End With

  Set objMessage = CreateObject( "CDO.Message" )
  With objMessage
    .Configuration = objConfig
    .From = strEmailFrom
    .To = strEmailToAddress
    .Subject = strEmailSubject
    .HTMLBody = strTextBody
    .AddAttachment strZipDest
    .Fields("urn:schemas:mailheader:disposition-notification-to") = StrEmailResponse
    .Fields("urn:schemas:mailheader:return-receipt-to") = StrEmailResponse
    .DSNOptions = 14
    .Send
  End With

  Set objMessage = Nothing
  Set objConfig = Nothing
What I would like to do is to place a copy of this email in the 'Sent Items' Mailbox for the specified user in the script (e.g. sendusername). Is it possible to connect to Exchange somehow and do this? Thank you...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top