• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Pulling my hair out!

JeffPell

n00b
Joined
Aug 24, 2005
Messages
49
I am trying to attach a file to an email through CDO. This fill will be generated through a web based form. My company wants to put together a resume submission form to let people easily submit resumes for available positions. I am extremely new to scripting/coding and I would appreciate detailed help with this.

Per someone's suggestion I have been trying to use FileSystemObject and I have been unsuccessful. Every time I try to test the page on my computer it hangs and says "waiting for localhost".

Here is the script I am using:

<%
Dim objMail, objMailConf
Dim fs, fname
Set fs = Server.CreateObject("Scripting.FileSystemObject")
Set fname = Request.Form("resume")
fs.CopyFile fname, "c:\access\"
Set objMail = Server.CreateObject("CDO.Message")
Set objMailConf = Server.CreateObject("CDO.Configuration")

objMailConf.Fields.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMailConf.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.enter.net"
objMailConf.fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMailConf.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMailConf.Fields.Update

Set objMail.Configuration = objMailConf
objMail.From = Request.Form("emailAddress")
objMail.To = "mail@mail.com"

objMail.Subject = Request.Form("emailSubject")
objMail.TextBody = Request.Form("emailText") & vbcrlf & "Home Phone Number: (" & Request.Form("homeArea") & ")" & Request.Form("homeNumber") & vbcrlf & "Cell Phone Number: (" & Request.Form("cellArea") & ")" & Request.Form("cellNumber")
objMail.AttachFile fname
objMail.Fields.Update
objMail.Send
Set objMail = Nothing
Set obMailConf = Nothing
Set fname = Nothing
Set fs = Nothing
%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="jya.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div align="center" class="tdh">
<%
Dim strfirstName
Dim strlastName
Dim strresume
strresume = Request.Form("resume")
strfirstName = Request.Form("firstName")
strlastName = Request.Form("lastName")
Response.Write "<p>Thank you, "
Response.Write "<b>"
Response.Write strfirstName
Response.Write "&nbsp;"
Response.Write strlastName
Response.Write "</b>"
Response.Write ", for your interest in the Agency</p>"
Response.Write "<br>"
Response.Write "<p>Your resume has been submitted.</p>"
Response.Write "<br>"
Response.Write strresume
%>
 
If your using Visual Studio and IIS on the same server, you can debug it and go through it line by line as the server processes it to see what it breaks.

I think it might be a permission issue though
 
Back
Top