Solved

Send email with ABCUpload

Posted on 2004-09-02
7
1,121 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP Focus problem 3 71
Questions about INCLUDE FILES 2 43
is this a cms? 8 69
IP API - need data... 4 30
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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/…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

740 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