Hi
I have a simple working contact form.
The asp:Code:<form method="post" action="process.asp" name="myform"> <label for="Name">Name:</label> <input type="text" name="Name" id="Name" /> <label for="Email">Email:</label> <input type="text" name="Email" id="Email" /> <label for="Email">Telephone:</label> <input type="text" name="Telephone" id="Telephone" /> <label for="Message">Message:</label><br /> <textarea name="Message" rows="40" cols="20" id="Message"></textarea> <div> <input type="image" src="assets/img/sendBtn.png" name="submit" value="Submit" class="submit-button" /> </div> </form>
I want the user to have the facility of uploading a word document.Code:Set ObjSendMail = CreateObject("CDO.Message") ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ObjSendMail.Configuration.Fields.Update ObjSendMail.To = "myemail@email.com" ObjSendMail.Subject = "Query" ObjSendMail.From = Session("email") ObjSendMail.TextBody= messageBody ObjSendMail.Send Set ObjSendMail = Nothing Response.Write("Email has been sent")
I add this line here:
i add this to the html form:Code:ObjSendMail.From = Session("email") ObjSendMail.TextBody= messageBody ObjSendMail.AddAttachment Request.Form("rob")
The form has stopped submitting and produces the error:Code:<label for="Email">CV:</label> <input type="hidden" name="rob" value="100" /> <input name="file" type="file" />
line 29 is this:Code:CDO.Message.1 error '800c000d' Unknown Error /process.asp, line 29
Can anyone spot what i am missing here please?Code:ObjSendMail.AddAttachment Request.Form("rob")
Thanks



Reply With Quote



Bookmarks