DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP (http://www.daniweb.com/forums/forum62.html)
-   -   Send email with attachment (http://www.daniweb.com/forums/thread88750.html)

michael.ngobeni Sep 6th, 2007 5:53 am
Send email with attachment
 
I am having a problem with sending an email with an attachment

Set msg = CreateObject("CDO.Message")
msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 msg.Configuration.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").Value="100.1.2.3"
msg.Subject = "Test Subject"
msg.From = "some@email.com"
msg.To = "some@email.com"
msg.TextBody = "Test Message"
msg.AddAttachment "C:\files\a.doc")

This works fine, but my problem is when a client/user use his computer to send an email to a remote server over the web
I believe the msg.AddAttachment "C:\files\a.doc") will change to something like msg.AddAttachment "the user local hard drive")

How do I solve this?

kaykays Sep 11th, 2007 5:11 am
Re: Send email with attachment
 
You can use the Server.MapPath("/") function to find the full path.


All times are GMT -4. The time now is 7:02 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC