By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,321 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,321 IT Pros & Developers. It's quick & easy.

Can't attach attachments in email using ASP CDO

P: n/a
Hi

I try to grab the checked files from HTML page and then send those PDF
files as attachments. It can just send email, there are no PDF files
attached. Can anybody point out my error?

My idea is:
When people check the check boxes in HTML page for the PDF files, it
will transfer the files' name to ASP page. Then, it will attach it in
the email.

ASP file - myMail.asp
---------------------

<%@ Language=VBScript %>
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"
-->

<%
SUB sendmail( toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds

Const cdoSendUsingPort = 2

Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
..Item(cdoSendUsingMethod) = cdoSendUsingPort
..Item(cdoSMTPServer) = "newserver"
..Item(cdoSMTPServerPort) = 25
..Item(cdoSMTPconnectiontimeout) = 10
..Update
End With

Set objCDO.Configuration = iConf

objCDO.From = "in**@axiomcollege.com.au"
objCDO.To = toWho
objCDO.Subject = Subject

courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next

objCDO.TextBody = Body
objCDO.Send
END SUB

toWho = TRIM( Request.Form("To") )
Subject = TRIM( Request.Form("Subject") )
Body = TRIM( Request.Form("Body") )
IF toWho <> "" THEN
sendMail toWho, Subject, Body

'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
Response.Write "Email Sent"
END IF
%>

<html>
<body>
<form action="mymail.asp" method="post" ID=Form1>
<table cellspacing=0 cellpadding=2>
<tr>
<td> From: in**@domain.com.au </td>
</tr>
<tr>
<td> To: <input type="text" name="To" size="20" ID=Text1></td>
</tr>
<tr>
<td> Subject: <input type="text" name="Subject" size="20"
ID=Text2></td>
</tr>
<tr>
<td> Attachments: </td>
<td>
<%
courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )
For Each member in courseOutline
response.write member & "<br>"
Next
%>
</td>
</tr>
<tr>
<td>Message: </td>
</tr>
<tr>
<td><textarea rows="10" name="Body" cols="40"
ID=Textarea1></textarea></td>
</tr>
<tr>
<td colspan=2><input type="Submit" Name="Send" Value="Send Email"
</td>

</tr>
<tr>
<td>
<%
msm = Request.Form("Test")
response.write msm
%>
</td>
</tr>
</table>
</form>
</body>
</html>
HTML file - mailform.htm
---------
<html>
<head>
<title>Request for More info</title>
</head>
<body>
<form action="mymail.asp" method="post">
<p>
MS Outlook PDF Document
<input type="checkbox" value="outlook.pdf" name="Bus" />
</p>
<p>
MS Word PDF Document
<input type="checkbox" value="word.pdf" name="Bus" />
</p>
<p>
MS Excel PDF Document
<input type="checkbox" value="excel.pdf" name="Bus" />
</p>
<p>
<input type="submit" value="Submit" name="Submit" />
</p>
</form>
</body>
</html>
Jul 19 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Have you confirmed that your code thinks that some file should be attached?
<%
'...
courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

RESPONSE.WRITE UBOUND(courseOutline)
RESPONSE.END

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next
'...
%>

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hi

I try to grab the checked files from HTML page and then send those PDF
files as attachments. It can just send email, there are no PDF files
attached. Can anybody point out my error?

My idea is:
When people check the check boxes in HTML page for the PDF files, it
will transfer the files' name to ASP page. Then, it will attach it in
the email.

ASP file - myMail.asp
---------------------

<%@ Language=VBScript %>
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"
-->

<%
SUB sendmail( toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds

Const cdoSendUsingPort = 2

Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "newserver"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With

Set objCDO.Configuration = iConf

objCDO.From = "in**@axiomcollege.com.au"
objCDO.To = toWho
objCDO.Subject = Subject

courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next

Jul 19 '05 #2

P: n/a
I tested the courseOutline array using For Each..Next Loop
All items I selected in the HTML page are in the courseOutline Array.
I don't know why I still can't attach those files as attachments in
email. There are no error pop out either. Any idea?

Cheers

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<#A**************@TK2MSFTNGP11.phx.gbl>...
Have you confirmed that your code thinks that some file should be attached?
<%
'...
courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

RESPONSE.WRITE UBOUND(courseOutline)
RESPONSE.END

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next
'...
%>

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hi

I try to grab the checked files from HTML page and then send those PDF
files as attachments. It can just send email, there are no PDF files
attached. Can anybody point out my error?

My idea is:
When people check the check boxes in HTML page for the PDF files, it
will transfer the files' name to ASP page. Then, it will attach it in
the email.

ASP file - myMail.asp
---------------------

<%@ Language=VBScript %>
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"
-->

<%
SUB sendmail( toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds

Const cdoSendUsingPort = 2

Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "newserver"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With

Set objCDO.Configuration = iConf

objCDO.From = "in**@axiomcollege.com.au"
objCDO.To = toWho
objCDO.Subject = Subject

courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next

Jul 19 '05 #3

P: n/a
Well, now is when you debug, by creating a test asp page that just tries to
attach one small text file to a mail object and is as simple as possible.
Try to narrow down where the problem may be until you find it.

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
I tested the courseOutline array using For Each..Next Loop
All items I selected in the HTML page are in the courseOutline Array.
I don't know why I still can't attach those files as attachments in
email. There are no error pop out either. Any idea?

Cheers

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<#A**************@TK2MSFTNGP11.phx.gbl>...
Have you confirmed that your code thinks that some file should be
attached?
<%
'...
courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

RESPONSE.WRITE UBOUND(courseOutline)
RESPONSE.END

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next
'...
%>

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
> Hi
>
> I try to grab the checked files from HTML page and then send those PDF
> files as attachments. It can just send email, there are no PDF files
> attached. Can anybody point out my error?
>
> My idea is:
> When people check the check boxes in HTML page for the PDF files, it
> will transfer the files' name to ASP page. Then, it will attach it in
> the email.
>
> ASP file - myMail.asp
> ---------------------
>
> <%@ Language=VBScript %>
> <!--METADATA TYPE="typelib"
> UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
> Library" -->
> <!--METADATA TYPE="typelib"
> UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"
> -->
>
> <%
> SUB sendmail( toWho, Subject, Body )
> Dim objCDO
> Dim iConf
> Dim Flds
>
> Const cdoSendUsingPort = 2
>
> Set objCDO = Server.CreateObject("CDO.Message")
> Set iConf = Server.CreateObject("CDO.Configuration")
>
> Set Flds = iConf.Fields
> With Flds
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "newserver"
> .Item(cdoSMTPServerPort) = 25
> .Item(cdoSMTPconnectiontimeout) = 10
> .Update
> End With
>
> Set objCDO.Configuration = iConf
>
> objCDO.From = "in**@axiomcollege.com.au"
> objCDO.To = toWho
> objCDO.Subject = Subject
>
> courseOutline = Request.Form( "Bus" )
> courseOutline = Split( courseOutline, "," )
>
> For Each member in courseOutline
> filepath = Server.Path("/") & member
> objCDO.AddAttachment filepath
> Next

Jul 19 '05 #4

P: n/a
Hello Ray

I used Response.Write to print out every single elements inside
outlines array. All the elements are what I selected in HTML Page. I'm
even printed out the filepath after using Server.MapPath(). They are
correct either. I really don't where are the bugs.

But, the strange thing is if I'm hard coding the courseOutlines array
elements. Like:

Dim outlines(3)
outlines(0) = "outlook.txt"
outlines(1) = "word.txt"
outlines(2) = "excel.txt"

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It works. It can attach all documents in the email.

But, when I change it to:

outlines = Request.Form("Bus")
Outlines = Split( Outlines, "," )

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It doesn't work.

I printed out the filepath and elements in outlines. They are fine as
well.
Please Help. I'm feeling hopeless.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<O$*************@tk2msftngp13.phx.gbl>...
Well, now is when you debug, by creating a test asp page that just tries to
attach one small text file to a mail object and is as simple as possible.
Try to narrow down where the problem may be until you find it.

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
I tested the courseOutline array using For Each..Next Loop
All items I selected in the HTML page are in the courseOutline Array.
I don't know why I still can't attach those files as attachments in
email. There are no error pop out either. Any idea?

Cheers

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<#A**************@TK2MSFTNGP11.phx.gbl>...
Have you confirmed that your code thinks that some file should be
attached?
<%
'...
courseOutline = Request.Form( "Bus" )
courseOutline = Split( courseOutline, "," )

RESPONSE.WRITE UBOUND(courseOutline)
RESPONSE.END

For Each member in courseOutline
filepath = Server.Path("/") & member
objCDO.AddAttachment filepath
Next
'...
%>

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
> Hi
>
> I try to grab the checked files from HTML page and then send those PDF
> files as attachments. It can just send email, there are no PDF files
> attached. Can anybody point out my error?
>
> My idea is:
> When people check the check boxes in HTML page for the PDF files, it
> will transfer the files' name to ASP page. Then, it will attach it in
> the email.
>
> ASP file - myMail.asp
> ---------------------
>
> <%@ Language=VBScript %>
> <!--METADATA TYPE="typelib"
> UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
> Library" -->
> <!--METADATA TYPE="typelib"
> UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"
> -->
>
> <%
> SUB sendmail( toWho, Subject, Body )
> Dim objCDO
> Dim iConf
> Dim Flds
>
> Const cdoSendUsingPort = 2
>
> Set objCDO = Server.CreateObject("CDO.Message")
> Set iConf = Server.CreateObject("CDO.Configuration")
>
> Set Flds = iConf.Fields
> With Flds
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "newserver"
> .Item(cdoSMTPServerPort) = 25
> .Item(cdoSMTPconnectiontimeout) = 10
> .Update
> End With
>
> Set objCDO.Configuration = iConf
>
> objCDO.From = "in**@axiomcollege.com.au"
> objCDO.To = toWho
> objCDO.Subject = Subject
>
> courseOutline = Request.Form( "Bus" )
> courseOutline = Split( courseOutline, "," )
>
> For Each member in courseOutline
> filepath = Server.Path("/") & member
> objCDO.AddAttachment filepath
> Next

Jul 19 '05 #5

P: n/a
Okay, the problem is that you are doing this in a two step process, and
you're not carrying through the values from the first page in which the user
checks the boxes for the files. When the user does that and submits the
form, he must then submit a second form to get the e-mail sending initiated.
At that second submission, your Request.Form("bus") is no longer valid, as
it's gone. You have to carry that through.

Check out your form in action here.
http://www.lane34.com/tabonni/mailform.htm Note the "View Code" link on the
"mymail.asp" page.

In your final version of this thing you're working on, you may want to
response.redirect your users after the mail is sent. Like,
response.redirect them to a "thankyou.htm" page or something. Otherwise,
they can just sit there and refresh/resubmit repeatedly.

Ray at home
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

I used Response.Write to print out every single elements inside
outlines array. All the elements are what I selected in HTML Page. I'm
even printed out the filepath after using Server.MapPath(). They are
correct either. I really don't where are the bugs.

But, the strange thing is if I'm hard coding the courseOutlines array
elements. Like:

Dim outlines(3)
outlines(0) = "outlook.txt"
outlines(1) = "word.txt"
outlines(2) = "excel.txt"

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It works. It can attach all documents in the email.

But, when I change it to:

outlines = Request.Form("Bus")
Outlines = Split( Outlines, "," )

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It doesn't work.

I printed out the filepath and elements in outlines. They are fine as
well.
Please Help. I'm feeling hopeless.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in

message news:<O$*************@tk2msftngp13.phx.gbl>...
Well, now is when you debug, by creating a test asp page that just tries to attach one small text file to a mail object and is as simple as possible. Try to narrow down where the problem may be until you find it.

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
I tested the courseOutline array using For Each..Next Loop
All items I selected in the HTML page are in the courseOutline Array.
I don't know why I still can't attach those files as attachments in
email. There are no error pop out either. Any idea?

Cheers

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<#A**************@TK2MSFTNGP11.phx.gbl>...
> Have you confirmed that your code thinks that some file should be
> attached?
>
>
> <%
> '...
> courseOutline = Request.Form( "Bus" )
> courseOutline = Split( courseOutline, "," )
>
> RESPONSE.WRITE UBOUND(courseOutline)
> RESPONSE.END
>
> For Each member in courseOutline
> filepath = Server.Path("/") & member
> objCDO.AddAttachment filepath
> Next
> '...
> %>
>
> Ray at work
>
>
> "tabonni" <ta*****@yahoo.com> wrote in message
> news:fb**************************@posting.google.c om...
> > Hi
> >
> > I try to grab the checked files from HTML page and then send those PDF> > files as attachments. It can just send email, there are no PDF files> > attached. Can anybody point out my error?
> >
> > My idea is:
> > When people check the check boxes in HTML page for the PDF files, it> > will transfer the files' name to ASP page. Then, it will attach it in> > the email.
> >
> > ASP file - myMail.asp
> > ---------------------
> >
> > <%@ Language=VBScript %>
> > <!--METADATA TYPE="typelib"
> > UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
> > Library" -->
> > <!--METADATA TYPE="typelib"
> > UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"> > -->
> >
> > <%
> > SUB sendmail( toWho, Subject, Body )
> > Dim objCDO
> > Dim iConf
> > Dim Flds
> >
> > Const cdoSendUsingPort = 2
> >
> > Set objCDO = Server.CreateObject("CDO.Message")
> > Set iConf = Server.CreateObject("CDO.Configuration")
> >
> > Set Flds = iConf.Fields
> > With Flds
> > .Item(cdoSendUsingMethod) = cdoSendUsingPort
> > .Item(cdoSMTPServer) = "newserver"
> > .Item(cdoSMTPServerPort) = 25
> > .Item(cdoSMTPconnectiontimeout) = 10
> > .Update
> > End With
> >
> > Set objCDO.Configuration = iConf
> >
> > objCDO.From = "in**@axiomcollege.com.au"
> > objCDO.To = toWho
> > objCDO.Subject = Subject
> >
> > courseOutline = Request.Form( "Bus" )
> > courseOutline = Split( courseOutline, "," )
> >
> > For Each member in courseOutline
> > filepath = Server.Path("/") & member
> > objCDO.AddAttachment filepath
> > Next

Jul 19 '05 #6

P: n/a
Hello Ray

Thank you very very very much. I had that problems for 2 weeks. I
didn't know where were the bugs.

May I ask you how did you find the bugs? What methods did you use?
Because I did print out all elements in the outlines array and checked
the filepaths. All are correct. I had no idea what's wrong. So, how
did you do that?

Thank you anyway. You save my life. :D

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<O#**************@TK2MSFTNGP11.phx.gbl>...
Okay, the problem is that you are doing this in a two step process, and
you're not carrying through the values from the first page in which the user
checks the boxes for the files. When the user does that and submits the
form, he must then submit a second form to get the e-mail sending initiated.
At that second submission, your Request.Form("bus") is no longer valid, as
it's gone. You have to carry that through.

Check out your form in action here.
http://www.lane34.com/tabonni/mailform.htm Note the "View Code" link on the
"mymail.asp" page.

In your final version of this thing you're working on, you may want to
response.redirect your users after the mail is sent. Like,
response.redirect them to a "thankyou.htm" page or something. Otherwise,
they can just sit there and refresh/resubmit repeatedly.

Ray at home
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

I used Response.Write to print out every single elements inside
outlines array. All the elements are what I selected in HTML Page. I'm
even printed out the filepath after using Server.MapPath(). They are
correct either. I really don't where are the bugs.

But, the strange thing is if I'm hard coding the courseOutlines array
elements. Like:

Dim outlines(3)
outlines(0) = "outlook.txt"
outlines(1) = "word.txt"
outlines(2) = "excel.txt"

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It works. It can attach all documents in the email.

But, when I change it to:

outlines = Request.Form("Bus")
Outlines = Split( Outlines, "," )

For i=0 to UBound(outlines)
filepath = Server.MapPath(".") & TRIM("\") & TRIM(outlines(i))
objCDO.AddAttachment filepath
Next

It doesn't work.

I printed out the filepath and elements in outlines. They are fine as
well.
Please Help. I'm feeling hopeless.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in

message news:<O$*************@tk2msftngp13.phx.gbl>...
Well, now is when you debug, by creating a test asp page that just tries to attach one small text file to a mail object and is as simple as possible. Try to narrow down where the problem may be until you find it.

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
>I tested the courseOutline array using For Each..Next Loop
> All items I selected in the HTML page are in the courseOutline Array.
> I don't know why I still can't attach those files as attachments in
> email. There are no error pop out either. Any idea?
>
> Cheers
>
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in > message news:<#A**************@TK2MSFTNGP11.phx.gbl>...
>> Have you confirmed that your code thinks that some file should be
>> attached?
>>
>>
>> <%
>> '...
>> courseOutline = Request.Form( "Bus" )
>> courseOutline = Split( courseOutline, "," )
>>
>> RESPONSE.WRITE UBOUND(courseOutline)
>> RESPONSE.END
>>
>> For Each member in courseOutline
>> filepath = Server.Path("/") & member
>> objCDO.AddAttachment filepath
>> Next
>> '...
>> %>
>>
>> Ray at work
>>
>>
>> "tabonni" <ta*****@yahoo.com> wrote in message
>> news:fb**************************@posting.google.c om...
>> > Hi
>> >
>> > I try to grab the checked files from HTML page and then send those PDF >> > files as attachments. It can just send email, there are no PDF files >> > attached. Can anybody point out my error?
>> >
>> > My idea is:
>> > When people check the check boxes in HTML page for the PDF files, it >> > will transfer the files' name to ASP page. Then, it will attach it in >> > the email.
>> >
>> > ASP file - myMail.asp
>> > ---------------------
>> >
>> > <%@ Language=VBScript %>
>> > <!--METADATA TYPE="typelib"
>> > UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows
>> > Library" -->
>> > <!--METADATA TYPE="typelib"
>> > UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" >> > -->
>> >
>> > <%
>> > SUB sendmail( toWho, Subject, Body )
>> > Dim objCDO
>> > Dim iConf
>> > Dim Flds
>> >
>> > Const cdoSendUsingPort = 2
>> >
>> > Set objCDO = Server.CreateObject("CDO.Message")
>> > Set iConf = Server.CreateObject("CDO.Configuration")
>> >
>> > Set Flds = iConf.Fields
>> > With Flds
>> > .Item(cdoSendUsingMethod) = cdoSendUsingPort
>> > .Item(cdoSMTPServer) = "newserver"
>> > .Item(cdoSMTPServerPort) = 25
>> > .Item(cdoSMTPconnectiontimeout) = 10
>> > .Update
>> > End With
>> >
>> > Set objCDO.Configuration = iConf
>> >
>> > objCDO.From = "in**@axiomcollege.com.au"
>> > objCDO.To = toWho
>> > objCDO.Subject = Subject
>> >
>> > courseOutline = Request.Form( "Bus" )
>> > courseOutline = Split( courseOutline, "," )
>> >
>> > For Each member in courseOutline
>> > filepath = Server.Path("/") & member
>> > objCDO.AddAttachment filepath
>> > Next

Jul 19 '05 #7

P: n/a
It wasn't until I copied and pasted the code that you posted in your
original message and tried it that I saw something wrong. I first through
in the RESPONSE.WRITE filepath & "<br>" lines. When I did that, I saw that
the file paths were valid, but then when I submitted the second form and
didn't see them, I realized that there was no array of file paths. So,
where was that array supposed to come from? I saw that it was supposed to
come from Request.Form("BUS"). So, I did a view-source and searched for a
form element named BUS, and did not see one. I guess that's how I could
have discovered the issue anyway!

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

Thank you very very very much. I had that problems for 2 weeks. I
didn't know where were the bugs.

May I ask you how did you find the bugs? What methods did you use?
Because I did print out all elements in the outlines array and checked
the filepaths. All are correct. I had no idea what's wrong. So, how
did you do that?

Thank you anyway. You save my life. :D

"Ray Costanzo [MVP]" <my first name at

Jul 19 '05 #8

P: n/a
Anyway, I have to thanks you again.

May I ask you one more question? I don't know why the program generate
a tmp file everytime I submit the email form. For example, After I
selected all the documents I required and send an email, a tmp file
will be generated and be placed in the same directory of the
myMail.asp and the directories I put all the PDF files. I opened the
tmp file. There is all myMail.asp coding. How come?

Cheers
Bon
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<uj**************@tk2msftngp13.phx.gbl>...
It wasn't until I copied and pasted the code that you posted in your
original message and tried it that I saw something wrong. I first through
in the RESPONSE.WRITE filepath & "<br>" lines. When I did that, I saw that
the file paths were valid, but then when I submitted the second form and
didn't see them, I realized that there was no array of file paths. So,
where was that array supposed to come from? I saw that it was supposed to
come from Request.Form("BUS"). So, I did a view-source and searched for a
form element named BUS, and did not see one. I guess that's how I could
have discovered the issue anyway!

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

Thank you very very very much. I had that problems for 2 weeks. I
didn't know where were the bugs.

May I ask you how did you find the bugs? What methods did you use?
Because I did print out all elements in the outlines array and checked
the filepaths. All are correct. I had no idea what's wrong. So, how
did you do that?

Thank you anyway. You save my life. :D

"Ray Costanzo [MVP]" <my first name at

Jul 19 '05 #9

P: n/a
That is odd. I've never heard of that happening before. What's the name of
the file?

Ray at hom

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb*************************@posting.google.co m...
Anyway, I have to thanks you again.

May I ask you one more question? I don't know why the program generate
a tmp file everytime I submit the email form. For example, After I
selected all the documents I required and send an email, a tmp file
will be generated and be placed in the same directory of the
myMail.asp and the directories I put all the PDF files. I opened the
tmp file. There is all myMail.asp coding. How come?

Cheers
Bon

Jul 19 '05 #10

P: n/a
Hello Ray

Those files' name are ve-6F47 (the myMail.asp) and ve-6F4A
(mailForm.htm). But, every time I send an email, they will be
generated and the name will change as well. Like, ve-6F48, ve-6F49...
etc ve6F4A, ve6F4B... etc. Inside those TMP files are the coding of
myMail.asp and mailForm.htm.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
That is odd. I've never heard of that happening before. What's the name of
the file?

Ray at hom

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb*************************@posting.google.co m...
Anyway, I have to thanks you again.

May I ask you one more question? I don't know why the program generate
a tmp file everytime I submit the email form. For example, After I
selected all the documents I required and send an email, a tmp file
will be generated and be placed in the same directory of the
myMail.asp and the directories I put all the PDF files. I opened the
tmp file. There is all myMail.asp coding. How come?

Cheers
Bon

Jul 19 '05 #11

P: n/a
That is interesting. I honestly have no idea what could be on your server
that is generating .tmp files of your ASP pages. ??

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

Those files' name are ve-6F47 (the myMail.asp) and ve-6F4A
(mailForm.htm). But, every time I send an email, they will be
generated and the name will change as well. Like, ve-6F48, ve-6F49...
etc ve6F4A, ve6F4B... etc. Inside those TMP files are the coding of
myMail.asp and mailForm.htm.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
That is odd. I've never heard of that happening before. What's the name
of
the file?

Ray at hom

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb*************************@posting.google.co m...
> Anyway, I have to thanks you again.
>
> May I ask you one more question? I don't know why the program generate
> a tmp file everytime I submit the email form. For example, After I
> selected all the documents I required and send an email, a tmp file
> will be generated and be placed in the same directory of the
> myMail.asp and the directories I put all the PDF files. I opened the
> tmp file. There is all myMail.asp coding. How come?
>
> Cheers
> Bon
>

Jul 19 '05 #12

P: n/a
It's ok. Thank you for your help

By the way, how often you check the google newsgroup? If I have
problem later on, may I ask you again?

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<uZ**************@TK2MSFTNGP15.phx.gbl>...
That is interesting. I honestly have no idea what could be on your server
that is generating .tmp files of your ASP pages. ??

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
Hello Ray

Those files' name are ve-6F47 (the myMail.asp) and ve-6F4A
(mailForm.htm). But, every time I send an email, they will be
generated and the name will change as well. Like, ve-6F48, ve-6F49...
etc ve6F4A, ve6F4B... etc. Inside those TMP files are the coding of
myMail.asp and mailForm.htm.

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
That is odd. I've never heard of that happening before. What's the name
of
the file?

Ray at hom

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb*************************@posting.google.co m...
> Anyway, I have to thanks you again.
>
> May I ask you one more question? I don't know why the program generate
> a tmp file everytime I submit the email form. For example, After I
> selected all the documents I required and send an email, a tmp file
> will be generated and be placed in the same directory of the
> myMail.asp and the directories I put all the PDF files. I opened the
> tmp file. There is all myMail.asp coding. How come?
>
> Cheers
> Bon
>

Jul 19 '05 #13

P: n/a
Just post your questions to the group. Somebody'll probably answer them.

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
It's ok. Thank you for your help

By the way, how often you check the google newsgroup? If I have
problem later on, may I ask you again?

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<uZ**************@TK2MSFTNGP15.phx.gbl>...
That is interesting. I honestly have no idea what could be on your
server
that is generating .tmp files of your ASP pages. ??

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
> Hello Ray
>
> Those files' name are ve-6F47 (the myMail.asp) and ve-6F4A
> (mailForm.htm). But, every time I send an email, they will be
> generated and the name will change as well. Like, ve-6F48, ve-6F49...
> etc ve6F4A, ve6F4B... etc. Inside those TMP files are the coding of
> myMail.asp and mailForm.htm.
>
> Cheers
> Bon
>
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
>> That is odd. I've never heard of that happening before. What's the
>> name
>> of
>> the file?
>>
>> Ray at hom
>>
>> "tabonni" <ta*****@yahoo.com> wrote in message
>> news:fb*************************@posting.google.co m...
>> > Anyway, I have to thanks you again.
>> >
>> > May I ask you one more question? I don't know why the program
>> > generate
>> > a tmp file everytime I submit the email form. For example, After I
>> > selected all the documents I required and send an email, a tmp file
>> > will be generated and be placed in the same directory of the
>> > myMail.asp and the directories I put all the PDF files. I opened the
>> > tmp file. There is all myMail.asp coding. How come?
>> >
>> > Cheers
>> > Bon
>> >

Jul 19 '05 #14

P: n/a
If I want to make my ASP CDO email application to have Reply & Forward
functions, how can I do that? Do I need to use Outlook.Application
object? If so, do you know any website about it?

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in message news:<Ow**************@tk2msftngp13.phx.gbl>...
Just post your questions to the group. Somebody'll probably answer them.

Ray at work
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
It's ok. Thank you for your help

By the way, how often you check the google newsgroup? If I have
problem later on, may I ask you again?

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:<uZ**************@TK2MSFTNGP15.phx.gbl>...
That is interesting. I honestly have no idea what could be on your
server
that is generating .tmp files of your ASP pages. ??

Ray at work

"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
> Hello Ray
>
> Those files' name are ve-6F47 (the myMail.asp) and ve-6F4A
> (mailForm.htm). But, every time I send an email, they will be
> generated and the name will change as well. Like, ve-6F48, ve-6F49...
> etc ve6F4A, ve6F4B... etc. Inside those TMP files are the coding of
> myMail.asp and mailForm.htm.
>
> Cheers
> Bon
>
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:<#n**************@TK2MSFTNGP11.phx.gbl>...
>> That is odd. I've never heard of that happening before. What's the
>> name
>> of
>> the file?
>>
>> Ray at hom
>>
>> "tabonni" <ta*****@yahoo.com> wrote in message
>> news:fb*************************@posting.google.co m...
>> > Anyway, I have to thanks you again.
>> >
>> > May I ask you one more question? I don't know why the program
>> > generate
>> > a tmp file everytime I submit the email form. For example, After I
>> > selected all the documents I required and send an email, a tmp file
>> > will be generated and be placed in the same directory of the
>> > myMail.asp and the directories I put all the PDF files. I opened the
>> > tmp file. There is all myMail.asp coding. How come?
>> >
>> > Cheers
>> > Bon
>> >

Jul 19 '05 #15

P: n/a
You're new to newsgroups, aren't you. :] When you have a new topic, please
start a new thread. If you just keep using the same thread, the number of
eyes that read your question will be pretty low, as this just appears to be
part of a thread that is already in progress!

One thing that would make things a bit easier is if you started using a news
client to post to the newsgroups instead of Google's web-based interface.
If interested, see here for setup instructions of common usenet
applications. http://www.aspfaq.com/5007 http://www.aspfaq.com/2081 is
another good article.

Ray at home
"tabonni" <ta*****@yahoo.com> wrote in message
news:fb**************************@posting.google.c om...
If I want to make my ASP CDO email application to have Reply & Forward
functions, how can I do that? Do I need to use Outlook.Application
object? If so, do you know any website about it?

Cheers
Bon

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in

message news:<Ow**************@tk2msftngp13.phx.gbl>...
Just post your questions to the group. Somebody'll probably answer them.
Ray at

Jul 19 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.