Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attache file in email

Status
Not open for further replies.

carranz

Technical User
Nov 17, 2006
40
US
I was wonder if someone could help me on this. I have two asp pages to do this process. I have a input box where a user will browse to a file and load it in the text box. Then that would process that file to an email process for attachment but its not working for me any help would be appreciated. Also there is more code to this if needed i can post it

this is the browse page for input file code
<td colspan="2"><input type="file" name="file" size="40"></td>

then a button is clicked and it directs it to the 1email.asp page for the email process

<form name="form1" method="post" enctype="multipart/form-data" action="1email.asp">

<!--#include file="Loader.asp"-->
<%
Response.Buffer = True
' load object
Dim load
Set load = new Loader
' calling initialize method
load.initialize
' File binary data
Dim fileData
fileData = load.getFileData("file")
' File name
Dim fileName
fileName = LCase(load.getFileName("file"))
Dim nameInput
nameInput = load.getValue("name")
' Path where file will be uploaded
Dim string1
Dim string2
Dim string3
dim string4
string1 = fileName
string2= nameInput
string3 = string2 &"@"& string1

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "myserver info"
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "lin@test.com"
.To = "lin@exchange.com"
.Subject = "File Exchange"
.TextBody = "This is a test"
.AddAttachment (string3) HEAR IS MY ATTACHMENT
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top