Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Send email with ABCUpload

Posted on 2004-09-02
7
Medium Priority
?
1,144 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 800 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
Technology Partners: 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 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

916 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