|
Sending an e-mail attachment
We are going to use CDONTS again , this time we
are going to show how to send an attachment with your e-mail
.
Here is the code for this example
<%
Dim objCDONTS
'create an instance of the object
Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
'senders emial address
objCDONTS.From = "myaddress@email.com"
'recipients email address
objCDONTS.To = "someonelses@email.com"
'this is your subject (title of email)
objCDONTS.Subject = "here is the file"
'file to be attached
objCDONTS.AttachFile "d:\myfile.txt"
'main text body
objCDONTS.Body ="Here is the file we promised"
'send the email
objCDONTS.Send
Set objCDONTS = Nothing
%>
And thats it .
|