Solved

Send email with ABCUpload

Posted on 2004-09-02
7
1,113 Views
Last Modified: 2012-05-05
bubs tried to help me with this but we got stuck in a corner.

I'm trying to use ABCupload to upload a file then send an email.

My form page that browses to find the file and then Uploads the file code looks like this..

<form method="post" action="upload_success.asp?email=<%=Server.URLEncode(Request.QueryString("Email"))%>">
             
                    <div align="left">
                <p>
                  <input name="filefield" type="file" size="60">
                  <br>
                 

                  <br>
                  <input type="submit" name="submit" value="Upload File">
                </p>
              </div>
</form>

The processing page looks like this...

<!-- Send Email -->
<%
'Declare variables
Dim sMsg
Dim sTo
Dim sFrom
Dim sSubject
'Dim sTextBody 'use one or the other
Dim sHTMLBody

'Get data from previous page
'response.Write(Request.QueryString("email"))
'Response.End()
Set theForm = Server.CreateObject("ABCUpload4.XForm")
sTo = theForm("Email")
theForm.Overwrite = True
theForm("filefield")(1).Save theForm("filefield")(1).FileName

'sTo = Request.Querystring("Email")
sFrom = "kevin@mobiledataforce.com"
sSubject = "MobileDataforce Leads Uploaded"
'sTextBody = Request("sTextBody") 'use one or the other
sHTMLBody = Request("sHTMLBody")

Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
'=== Code added here to specify SMTP server and port

objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.fiberpipe.net"
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMail.Configuration.Fields.Update

' build HTML for message body
sHTMLBody = "<HTML>"
sHTMLBody = sHTMLBody & "<HEAD>"
sHTMLBody = sHTMLBody & "<BODY>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>Greetings,</font></br>"
sHTMLBody = sHTMLBody & "<p><font face='arial' size='2'>New leads have been uploaded to your section of the MobileDataforce partner site. Thanks for checking on this prospective customers</font></p>"
sHTMLBody = sHTMLBody & "<br>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>Regards,</font>"
sHTMLBody = sHTMLBody & "<br><br>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>Kevin Benedict</font>"
sHTMLBody = sHTMLBody & "<br>"
sHTMLBody = sHTMLBody & "0==============================0"
sHTMLBody = sHTMLBody & "<br>"
sHTMLBody = sHTMLBody & "<font face='Arial' color=blue size='2'>Kevin Benedict</font><br>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>MobileDataforce</font><br>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>Office (208) 288-2745 ext. 250</font><br>"
sHTMLBody = sHTMLBody & "<font face='Arial' size='2'>email <a href='mailto:kevin.benedict@mobiledataforce.com'>kevin.benedict@mobiledataforce.com</a><br>"
sHTMLBody = sHTMLBody & "0==============================0"
sHTMLBody = sHTMLBody & "</BODY>"
sHTMLBody = sHTMLBody & "</HTML>"

'=== End code to specify SMTP server and port
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Subject= sSubject
'objMail.TextBody = sTextBody 'use one or the other
objMail.HTMLBody = sHTMLBody

'Send the email
objMail.Send
'Set sMsg which will be used later
sMsg = "Your message was sent to: " & sTo

'Clean-up
Set objMail = Nothing

%>
<!-- Upload Files -->


I get the following error...
ABCUpload4.XField.4 error '80004005'

Unable to convert virtual to physical path. A Windows error - Unspecified error - (0x80004005) occurred.

/partnersite/regions/Ztest/upload_success.asp, line 40



Perhaps I should try using a hidden field on the first page to get the email. I'm just not sure.

Thanks
J
0
Comment
Question by:kevinbenedict
  • 3
  • 3
7 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11964064
Which is line 40?

FtB
0
 
LVL 12

Assisted Solution

by:GoofyDawg
GoofyDawg earned 200 total points
ID: 11964351
The error you're getting doesn't sound like a mail object error. It sounds as if the ABCUpload component can't save the file you've specified. I did notice one thing: Typically when you use a file field, you have to include enctype="multipart/form-data" in your form tag. I don't know if ABCUpload requires this, but other components I've used will produce an error if the entype is not set to this. Otherwise, your message code seems to look okay, though I'd like to ask why you use the base object (CDO) instead of CDONTS. Understandable if your mail server is different from your web server.

GoofyDawg
0
 

Author Comment

by:kevinbenedict
ID: 11964596
ftb
line 40 is

theForm("filefield")(1).Save theForm("filefield")(1).FileName


goofyDawg
I think I'm supposed to add the multipart/form-data. I'll go add that and see what happens.


0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:kevinbenedict
ID: 11964693
When I add the multipart/form-data and submit the form I get the following...

Request object error 'ASP 0208 : 80004005'

Cannot use generic Request collection

/partnersite/regions/Ztest/upload_success.asp, line 46

Cannot use the generic Request collection after calling BinaryRead.


line 46 is

sHTMLBody = Request("sHTMLBody")
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 150 total points
ID: 11965441
sHTMLBody = Request("sHTMLBody")

will have to be something like:

sHTMLBody = theForm("sHTMLBody")


FtB
0
 

Author Comment

by:kevinbenedict
ID: 11966036
Perfect. That got it.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 11966094
Glad to have helped,

FtB
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question