Current location: Hot Scripts Forums » Programming Languages » ASP » problem sending email with CDO


problem sending email with CDO

Reply
  #1 (permalink)  
Old 04-11-05, 12:04 AM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
problem sending email with CDO

im trying to send a CDO message and it works for most of the ASP pages i have, except for one particular one.
im trying to attach it to the message. it worked fine for 3 weeks, but now it wont work anymore. help!!!
Reply With Quote
  #2 (permalink)  
Old 04-11-05, 01:59 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
In order for anyone to help you we need more details!

Whats going on? Any errors? If so what is the code giving the error?
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #3 (permalink)  
Old 04-11-05, 08:13 AM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
here is the mail source

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="inv.database@chartercom.com"
myMail.To="ayodeji.ojo@chartercom.com"
myMail.TextBody="This is a message."
myMail.AddAttachment "http://ksusmiis02/parts_db/project4/testing.asp"
myMail.Send
Reply With Quote
  #4 (permalink)  
Old 04-11-05, 08:14 AM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Post here is the whole file

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/access_conn.asp" -->
<%
CParam = Cstr(Request("ID"))
%>
<%
sExport = Request.QueryString("export") ' Load Export Request
If sExport = "html" Then

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="inv.database@chartercom.com"
myMail.To="ayodeji.ojo@chartercom.com"
myMail.TextBody="This is a message."
myMail.AddAttachment "http://ksusmiis02/parts_db/project4/testing.asp"
myMail.Send
' Printer Friendly
End If
%>

<%
Dim Cart_info
Dim Cart_info_numRows

Set Cart_info = Server.CreateObject("ADODB.Recordset")
Cart_info.ActiveConnection = MM_access_conn_STRING
Cart_info.Source = "SELECT * FROM Cart_Full WHERE ID = " + Replace(CParam, "'", "''")
Cart_info.CursorType = 0
Cart_info.CursorLocation = 2
Cart_info.LockType = 1
Cart_info.Open()

Cart_info_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Cart_info_numRows = Cart_info_numRows + Repeat1__numRows
%>


<!--##session myDwHeader##-->
<html>
<head>
<title><!--##=PROJ.ProjName##--></title>
<style type="text/css">
<!--
.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style3 {font-size: 10px}
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; }
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #006699; }
.style8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; color: #006699; }
-->
</style>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#ffffff">
<table width="100%" bgcolor="#FFFFFF" bordercolor="#FFFFFF">
<!--DWLayoutTable-->
<tr bgcolor="#FFFFFF">
<td width="62" height="21" valign="middle" class="style6">Requestor:</td>

<td colspan="2" valign="middle" class="style6"><%=(Cart_info.Fields.Item("Requesto r").Value)%></td>
<td width="31" valign="middle" class="style6">GLID:</td>
<td valign="middle" class="style6"><%=(Cart_info.Fields.Item("Glid No").Value)%></td>
<td colspan="3" valign="middle" class="style6">Project #/Project Name : </td>
<td colspan="3" valign="middle"><span class="style6"><%=(Cart_info.Fields.Item("Project No").Value)%>/<%=(Cart_info.Fields.Item("Project Name").Value)%></span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="22" colspan="2" valign="middle" class="style6">Contractor:</td>
<td width="136" valign="middle" class="style6"><%=(Cart_info.Fields.Item("Contract or").Value)%></td>
<td></td>
<td width="27"></td>
<td width="36" valign="middle" class="style6">ID #: </td>
<td width="84" valign="middle" class="style6"><%=(Cart_info.Fields.Item("ID").Val ue)%></td>
<td width="18">&nbsp;</td>
<td width="46"></td>
<td width="157"></td>
<td width="100%"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="21" colspan="2" valign="middle" class="style6">Pick Up Date : </td>
<td valign="middle" bgcolor="#EEEEEE" class="style6"><%=( "Pick up on the next Friday after " & Cart_info.Fields.Item("Date").Value)%></td>
<td></td>
<td></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td rowspan="2" align="center" valign="middle" class="style6">Print Order </td>
<a href="testing.asp?ID=<%=CParam%>&export=html" target="_parent">
<td rowspan="2" align="center" valign="middle" class="style8">Complete Order </td></a>
<td>&nbsp;</td>
</tr>
<tr><td height="5"><img src="/spacer.gif" alt="" width="61" height="1"></td><td><img src="/spacer.gif" alt="" width="29" height="1"></td><td><img src="/spacer.gif" alt="" width="131" height="1"></td><td><img src="/spacer.gif" alt="" width="31" height="1"></td><td><img src="/spacer.gif" alt="" width="25" height="1"></td><td><img src="/spacer.gif" alt="" width="34" height="1"></td><td><img src="/spacer.gif" alt="" width="84" height="1"></td><td><img src="/spacer.gif" alt="" width="16" height="1"></td><td><img src="/spacer.gif" alt="" width="46" height="1"></td><td><img src="/spacer.gif" alt="" width="153" height="1"></td><td></td></tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="2" >


<!--DWLayoutTable-->
<tr bgcolor="#CCCCCC" border="1">
<td height="25" align="center" valign="middle" bgcolor="#EEEEEE" class="style1 style3">Inventory # </td>
<td align="center" valign="middle" bgcolor="#EEEEEE" class="style4">Description</td>
<td align="center" valign="middle" bgcolor="#EEEEEE" class="style4">BIN Location </td>
<td align="center" valign="middle" bgcolor="#EEEEEE" class="style4">Part # </td>
<td align="center" valign="middle" bgcolor="#EEEEEE" class="style4">Amount</td>
<td width="128" align="center" valign="middle" bgcolor="#EEEEEE" class="style4">Issued</td>
<td width="128" align="center" valign="middle" bgcolor="#EEEEEE" class="style4">Back Order </td>
<td width="100%" align="center" valign="middle" bgcolor="#EEEEEE" class="style4"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Cart_info.EOF)) %>
<tr>
<td class="style6"><%=(Cart_info.Fields.Item("Inventor y").Value)%></td>
<td class="style6"><%=(Cart_info.Fields.Item("Descript ion").Value)%></td>
<td class="style6"><%=(Cart_info.Fields.Item("Location ").Value)%></td>
<td class="style6"><%=(Cart_info.Fields.Item("PartNo") .Value)%></td>
<td class="style6"><%=(Cart_info.Fields.Item("Amount") .Value)%></td>
<td class="style6"><%=(Cart_info.Fields.Item("Issued") .Value)%></td>
<td><%=(Cart_info.Fields.Item("Back Order").Value)%></td>
<td>&nbsp;</td></tr><tr><td height="7"><img src="/spacer.gif" alt="" width="129" height="1"></td><td><img src="/spacer.gif" alt="" width="136" height="1"></td><td><img src="/spacer.gif" alt="" width="119" height="1"></td><td><img src="/spacer.gif" alt="" width="111" height="1"></td><td><img src="/spacer.gif" alt="" width="117" height="1"></td><td><img src="/spacer.gif" alt="" width="110" height="1"></td><td><img src="/spacer.gif" alt="" width="36" height="1"></td><td></td></tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Cart_info.MoveNext()
Wend
%>
</table>
<!--##session myDwFooter##-->
</body>
</html>
<%
Cart_info.Close()
Set Cart_info = Nothing
%>
<!--##/session##-->
Reply With Quote
  #5 (permalink)  
Old 04-11-05, 10:05 AM
koncept
Guest
 
Posts: n/a
we still cannot help much with out any error messages
Reply With Quote
  #6 (permalink)  
Old 04-11-05, 10:35 AM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
this is the error message it gives

Technical Information (for support personnel)

Error Type:
(0x8004021A)
/parts_db/project4/testing.asp, line 15


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

Page:
GET /parts_db/project4/testing.asp

Time:
Monday, April 11, 2005, 10:32:33 AM

and it only does that for this particular file, but works for others
Reply With Quote
  #7 (permalink)  
Old 04-11-05, 01:00 PM
protecweb protecweb is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
You cant add an attachment like that as far as i am aware. You need to enter a physical drive path to a valid file.

e.g:

myMail.AddAttachment "http://ksusmiis02/parts_db/project4/testing.asp"

is wrong.
__________________
Regards, Sam - http://www.protecweb.co.uk
Windows 2003 shared and reseller hosting with .NET, MS SQL Server and lots of components.
AdvancedIcons.com - Professional XP style icons.
Reply With Quote
  #8 (permalink)  
Old 04-11-05, 01:43 PM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
i have been able to add it until 3 days ago.
Reply With Quote
  #9 (permalink)  
Old 04-11-05, 05:41 PM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for the help guys, i figured it out
Reply With Quote
  #10 (permalink)  
Old 05-16-05, 11:06 PM
nedums_b nedums_b is offline
New Member
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

Me got the same problem ?
Could you please let me know how did you over come this?
is that by extending the script timeout?

I appriciate your help

Thanks
Nedums
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error sending email davehoward PHP 3 12-17-04 01:17 PM
ASPmail sending email to submiter Asgaroth ASP 2 05-10-04 09:09 AM
Sending form data + attatchments in email php-learner PHP 2 02-14-04 12:18 AM
send email when sending form (asp) bmatth1 Script Requests 0 09-30-03 05:52 AM


All times are GMT -5. The time now is 03:22 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.