|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi!
I'm trying to get my users to attach a local file to the mail they sending me from my page. <B>My form code is:</B> form method="POST" action="mail-annonse.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript" input type="text" name="FromName" size="20" input type="text" name="FromAddress" size="20" input type="file" name="AddAttachment" size="20" input type="submit" value="Send" name="B1" input type="reset" value="Reset" name="B2" <b>My asp code is:</b> Session("FromName") = Request("FromName") Session("FromAddress") = Request("FromAddress") Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.FromName = Session("FromName") Mailer.FromAddress = Session("FromAddress") Mailer.RemoteHost = "smtpgw.activeisp.com" Mailer.AddRecipient "joachim@obur.no", "joachim@obur.no" Mailer.Subject = "Annonsering på obur.no" for each whatever in request.form If instr(whatever,"mail-")=0 then Mailer.BodyText = whatever & "=" & vbcrlf Mailer.BodyText = request.form(whatever) & vbcrlf & vbcrlf end if next if Mailer.SendMail then Response.Write "The e-mail is sendt..." else Response.Write "The mail was not sendt. The error was " & Mailer.Response end if Session.Abandon <b>How can I get it to work? Can I use something like:</b> Session("AddAttachment") = Request("AddAttachment") <b>and</b> Mailer.AddAttachment = Session("AddAttachment") <b>or</b> Mailer.Attachments.Add = Session("AddAttachment") <b>Please help...</b> Angelot (joachim@obur.no) |
|
#2
|
|||
|
|||
|
Somebody....
Please - sombody help!
|
|
#3
|
|||
|
|||
|
You first have to get the file to the server
Visit this thread for two different asp solutions. Both are FREE
You'll have to get the file to the server first, then attach it to the email. Once the email is sent, the file can be deleted. You won't be able to attach the file from the browser. Michael |
|
#4
|
|||
|
|||
|
Thanx
This was what I was looking for....
I'm trying it now, and I think it works great! Again, thanx! Angelot :-D |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Howto: Attach a file with mail from form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|