Go Back   CP Web Hosting - reseller hosting > Server Scripting > ASP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2007, 04:10 AM
Senior Member
 
Join Date: May 2007
Posts: 290
Default upload images to send as an email attachment using ASP

Does anyone know how to upload images to send as an email attachment using ASP?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 07-04-2007, 04:12 AM
Senior Member
 
Join Date: Mar 2007
Posts: 274
Lightbulb

here is a scrip that attaches the file from your server

Code:
<HTML>
<BODY BGCOLOR="white">

<H1>aspSmartMail : Sample 5</H1>
<HR>
<%

	On error resume next

	Dim mySmartMail
	Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")

'	Mail Server
'	***********
	mySmartMail.Server = "mail.yourdomain.com"
	mySmartMail.ServerPort = 25
	mySmartMail.ServerTimeOut = 35

'	From
'	****
	mySmartMail.SenderName = "Your Name"
	mySmartMail.SenderAddress = "youremail@yourdomain.com"

'	To
'	**
	mySmartMail.Recipients.Add "yourfriend0@anydomain.com", "Friend0's name"
	mySmartMail.Recipients.Add "yourfriend1@anydomain.com", "Friend1's name"

'	Carbon copy
'	***********
	mySmartMail.CCs.Add "yourfriend2@anydomain.com", "Friend2's name"

'	Blind carbon copy
'	*****************
	mySmartMail.BCCs.Add "yourfriend3@anydomain.com", "Friend3's name"

'	Reply To
'	********
	mySmartMail.ReplyTos.Add "yourfriend4@anydomain.com", "Friend4's name"

'	Message
'	*******
	mySmartMail.Subject = "aspSmartMail Sample 5"
	mySmartMail.Body = "This mail which has been sent with aspSmartMail."

'	Parameters
'	**********
	mySmartMail.DateTime = "Wed, 23 febr 2000 12:00 +0600"
	mySmartMail.Organization = "your Society Inc."
	mySmartMail.XMailer = "Your Web Application"
	mySmartMail.Priority = 1
	mySmartMail.ReturnReceipt = false
	mySmartMail.ConfirmRead = true
	mySmartMail.ContentType = "text/plain"
	mySmartMail.Charset = "us-ascii"
	mySmartMail.Encoding = "base64"

'	Attached file
'	*************
	mySmartMail.Attachments.Add Server.MapPath("\aspSmartMail\sample.txt"), false

'	Send the message
'	****************
	mySmartMail.SendMail

	if err.number <> 0 then

		response.write("Error n° " &  err.number - vbobjecterror & " = " & err.description  & "<br>")

	else

		Response.Write "aspSmartMail has sent your message with this file as attachment : <br>"
		Response.Write mySmartMail.Attachments.Item(1).FilePathName

	end if

	set mySmartMail = nothing

%>
</body>
</html>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0