techpreparation-homepage

Home  Interview Questions  Aptitude Questions  Tutorials  Placement Papers  Search  Resume Guide  Soft Skills  Video  Forum  Blog


Technical Interview Questions

Visual Basic Interview Question
.NET Web Interview Questions
.NET Interview Questions
C# Interview Questions
                              .........More

Source Codes
Asp .NET Source Codes
Asp VB Script Source Codes
                              .........More

Soft Skills
Communication Skills
Leadership Skills
                              .........More

Subscribe to our Newsletters
Name:
Email:

 

 

  

Asp/VB Script Source Codes

Send Email With Attachment

<%
' Note that I'm using the Win2000 CDO syntax! I'm
' assuming most people are off of NT4 by now.

' For simplicity and because I'm not letting you enter
' them, I'm not validating email addresses. If you let
' people enter them you should at least do some
' rudimentary level of validation to ensure entries
' are valid.

Dim objMessage

Set objMessage = Server.CreateObject("CDO.Message")

With objMessage
' Set message attributes
.To = "Full Name <user name@some domain.com>"
.From = "Full Name <user name@some domain.com>"
.Subject = "Email Attachment Sample"
.TextBody = "This email should have an attachment attached!"

' Attachment using known static physical path
'.AddAttachment "c:\somepath\somefile.txt"

' Attachment using mappath to find the physical path
.AddAttachment Server.MapPath("images/asp101-100x30.gif")

' Attachment added directly from a URL
.AddAttachment "http://www.asp101.com/samples/images/asp101-100x30.gif"

' Send message - uncomment the following line only
' AFTER you've entered appropriate To and From
' addresses above. Then the script will actually
' send the messages.
'.Send
End With

Set objMessage = Nothing
%>


<<<----- Return to Asp/VB Script Source Code Questions Page.


Have a Question ? post your questions here. It will be answered as soon as possible.

Check Microsoft .Net Interview Questions for more Microsoft .Net Interview Questions with Answers.

Check .Net Database Interview Questions for more .Net Database Interview Questions with answers

Check Job Interview Questions for more Interview Questions with Answers