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?

You can use the Server.MapPath("/") function to find the full path.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.