|
|
|
|
Send an Email Attachment Using CDOSYS in ASP
<%
Option Explicit
Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2
.Item(sch & "smtpserver") = "127.0.0.1"
.Item(sch & "smtpserverport") = 25
.Item(sch & "smtpconnectiontimeout") = 60
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "youremail@yoursite.com"
.To = "recipient@theirsite.com"
.Subject = "Test Email"
.HTMLBody = "This is a test email."
.AddAttachment "c:\images\myimage.jpg"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site.
Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.
|
|
|
|
|