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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formmail with attachment

Status
Not open for further replies.

aaronjonmartin

Technical User
Jul 9, 2002
475
GB
Hi im trying to get an asp script together which will take the input from a webform and send it as an email to my email address. This i have been successful with. However I now want to have an attach file option on the form which when a word doc is added and the form submitted the file is attached to the email and sent to me. Iam totally in the dark as to how i can do this so any information, help, links, etc will be greatly appreciated. Thanks

Aaron

"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
 
If you are using cdonts (tut tut v. bad, this is now deprecated) use

Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.attachFile("\\server\share\file.txt","test.txt")
objMail.Send("user@Domain.com","user@Domain.com","Test Mail",
"This is a test mail using CDO",0)
Set objMail = nothing

If you are using cdo.message (hurrah!!)
then use

With cdoMessage
Set .Configuration = cdoConfig
.From = "from@me.com"
.To = "to@me.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.AddAttachment "c:\boot.ini"
.Send
End With


Hope this helps

Simon
 
Do you have access to any mail server components like Jmail for example?


Regards


M
 
Sorry I meant server upload components....


/M
 
Thanks for the comments guys i will check all this info out and repost when i have an idea of where i can go from here. Thanks again

Aaron

"It's so much easier to suggest solutions when you don't know too much about the problem."
Malcolm Forbes (1919 - 1990)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top