|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble Sending Attachments with CDONTS...
<i><b>Originally posted by : Thomas Kuhn</b></i><br />I'm developing an ASP web site for customer tracking, and wanted to be able to broadcast e-mail all contacts. I developed an HTML page with a form that passes variables to an ASP to send the mail through CDONTS. It works, as long as I don't have an attachment to send with the e-mail. The code I'm using to send the mail is:<br /><br /><%<br />Dim MailObj<br />Set MailObj = Server.CreateObject("CDONTS.NewMail")<br />if len(Request.Form("file1")) > 0 Then<br /> strattachment = Request.Form("File1")<br /> strFileName = strAttachment<br /> do while instr(txtFileName, """) <> 0<br /> strFileName = Mid(strFileName, 2)<br /> loop<br /> MailObj.AttachFile strAttachment, strFileName <br />end if <br />MailObj.From = strFrom<br />MailObj.To = strTo<br />MailObj.Subject = strSubject<br />MailObj.Body = strBody<br />MailObj.Send<br />Set MailObj = Nothing<br />%><br /><br />If there is no attachment (len(Request.Form("file1"))=0) the ASP code works great and sends mail. If I specify an attachment, the code results in the following error message:<br /><br />error '80004005' <br />Unspecified error <br />sendmail.asp, line 109 <br /><br />where line 109 is the "MailObj.AttachFile strAttachment, strFileName" line. I've checked, and the strAttachment and strFileName variables are valid and correct.<br /> Any ideas on what's wrong with this??? TIA.<br /><br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve</b></i><br />to test it out manually place the correct path to the dir and file to make sure its working before doing it dynamically. that is what i do to test it out...<br /><br /><br /><br />------------<br />Thomas Kuhn at 3/8/2000 1:24:52 PM<br /><br />I'm developing an ASP web site for customer tracking, and wanted to be able to broadcast e-mail all contacts. I developed an HTML page with a form that passes variables to an ASP to send the mail through CDONTS. It works, as long as I don't have an attachment to send with the e-mail. The code I'm using to send the mail is:<br /><br /><%<br />Dim MailObj<br />Set MailObj = Server.CreateObject("CDONTS.NewMail")<br />if len(Request.Form("file1")) > 0 Then<br /> strattachment = Request.Form("File1")<br /> strFileName = strAttachment<br /> do while instr(txtFileName, """) <> 0<br /> strFileName = Mid(strFileName, 2)<br /> loop<br /> MailObj.AttachFile strAttachment, strFileName <br />end if <br />MailObj.From = strFrom<br />MailObj.To = strTo<br />MailObj.Subject = strSubject<br />MailObj.Body = strBody<br />MailObj.Send<br />Set MailObj = Nothing<br />%><br /><br />If there is no attachment (len(Request.Form("file1"))=0) the ASP code works great and sends mail. If I specify an attachment, the code results in the following error message:<br /><br />error '80004005' <br />Unspecified error <br />sendmail.asp, line 109 <br /><br />where line 109 is the "MailObj.AttachFile strAttachment, strFileName" line. I've checked, and the strAttachment and strFileName variables are valid and correct.<br /> Any ideas on what's wrong with this??? TIA.<br /><br />
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : Thomas Kuhn</b></i><br />Steve,<br /> Been there, done that... I tried removing the variables and hardcoding specific file name in there and still get same response. I do know also that the code generating the filename is working correctly, checked that too.<br /><br /><br />------------<br />steve at 3/8/2000 3:18:23 PM<br /><br />to test it out manually place the correct path to the dir and file to make sure its working before doing it dynamically. that is what i do to test it out...<br /><br /><br /><br />------------<br />Thomas Kuhn at 3/8/2000 1:24:52 PM<br /><br />I'm developing an ASP web site for customer tracking, and wanted to be able to broadcast e-mail all contacts. I developed an HTML page with a form that passes variables to an ASP to send the mail through CDONTS. It works, as long as I don't have an attachment to send with the e-mail. The code I'm using to send the mail is:<br /><br /><%<br />Dim MailObj<br />Set MailObj = Server.CreateObject("CDONTS.NewMail")<br />if len(Request.Form("file1")) > 0 Then<br /> strattachment = Request.Form("File1")<br /> strFileName = strAttachment<br /> do while instr(txtFileName, """) <> 0<br /> strFileName = Mid(strFileName, 2)<br /> loop<br /> MailObj.AttachFile strAttachment, strFileName <br />end if <br />MailObj.From = strFrom<br />MailObj.To = strTo<br />MailObj.Subject = strSubject<br />MailObj.Body = strBody<br />MailObj.Send<br />Set MailObj = Nothing<br />%><br /><br />If there is no attachment (len(Request.Form("file1"))=0) the ASP code works great and sends mail. If I specify an attachment, the code results in the following error message:<br /><br />error '80004005' <br />Unspecified error <br />sendmail.asp, line 109 <br /><br />where line 109 is the "MailObj.AttachFile strAttachment, strFileName" line. I've checked, and the strAttachment and strFileName variables are valid and correct.<br /> Any ideas on what's wrong with this??? TIA.<br /><br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Trouble Sending Attachments with CDONTS... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|