Classic ASP - Email form with attached file - please help
- by apg1985
Hi Guys,
Ive got abit of a problem ive got an email web form that send the input to an email address but what I now need is a file input field were the user can also send an image as an attachment.
So contact name, logo (attachment).
Ive been told in order to send the attachment it needs to be saved in a folder on my hosting before it can be sent. Ive spoken to the hosting company and they dont have anything in place to make this easier such as aspupload.
In the form name="contactname" and name="logo" I have a folder in the root directory called logos (this asp page also exists in the root directory)
Man I hope someone can help me spent along time looking for answers
Dim contactname, logo
contactname = request.form("contactname")
If request("contactname") <> "" THEN
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Form"
myMail.From="web@email"
myMail.To="web@email"
myMail.HTMLBody = "" & contactname & ""
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay.host"
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing