Salve ragazzi scusate ma ho un problema sull'invio di più allegati tramite mail.
Vedendo in giro ho ricavato questo script che mi permtte di inviare tramite mail un'allegato.
Il form invece è questo:codice:<% Dim form, subject, allegato %> <Html> <head> <title>Email spedita</title> </head> <body> <% Dim oUpload Set oUpload = new cUpload oUpload.SetPath "upload\" oUpload.Load if oUpload.Count=0 then allegato = "" Else While Not oUpload.EOF oUpload.Save() allegato = oUpload.GetFileName() oUpload.MoveNext Wend End if call Main() Sub Main() If Len(oUpload.Form("subject")) = 0 then no_sub() else manda_posta(form) ecco_fatto(nome) end if Set oUpload=Nothing End sub Sub no_sub() response.write "<div align='center'>" response.write "<table border='0' width='80%' cellspadding='4' cellspacing='4'>" response.write "<tr><td>Non hai inserito un subject</td></tr>" response.write "<tr><td>Per favore, torna indiedro e inseriscine uno </td></tr>" response.write "<tr><td align='middlè>" response.write "<a href=java-script:history.go(-1)>Pagina precedente</a>" response.write "</td></tr></table></div>" End Sub Sub manda_posta(form) Dim subject, testo Dim objMail, objMailConfig subject = oUpload.Form("subject") mittente = oUpload.Form("mittente") testo = oUpload.Form("testo") Set objMail = Server.CreateObject("CDO.Message") Set objMailConfig = Server.CreateObject ("CDO.Configuration") ' Proprietà di invio with objMailConfig ' SMTP mail server .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.eurnetcity.net" ' SMTP port .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ' CDO port .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' Timeout .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 .Fields.Update end with Set objMail.Configuration = objMailConfig objMail.From = "r.didonato@infotrading.it" objMail.To = oUpload.Form("destinatario") objMail.Subject = subject objMail.TextBody = testo If Len(allegato) <> 0 then objMail.AddAttachment Server.MapPath("upload\" & allegato) end if objMail.Fields("urn:schemas:httpmail:importance").Value = 0 objMail.Fields.update() objMail.Send Set objMail = Nothing end sub Sub ecco_fatto(nome) response.write "<div align='center'>" response.write "<table border='0' width='80%' cellspadding='4' cellspacing='4'>" response.write "<tr><td>Grazie " & subject & " per la mail</td></tr>" response.write "<tr><td align='middlè>" response.write "<a href=java-script:history.go(-2)>Torna indietro</a>" response.write "</td></tr></table></div>" End sub %> </body> </html>
Ora se carico tre foto lui mi fa arrivare in allegato sempre quella che carico nel terzo campo.codice:<HTML> <HEAD> <TITLE>Manda Email</TITLE> </HEAD> <BODY> <FORM ACTION="manda.asp" METHOD="post" enctype="multipart/form-data"> <div align="center"> <table border="0" width="85%" celpadding="2" cellspacing="2"> <tr> <td> <h1>Manda E-mail<hr align="LEFT" size="1" width="100%" color="navy"></h1> </td> </tr> <tr> <td> Compila il Form </td> </tr> <td align="center"> <table width="60%" border="0" celpadding="2" cellspacing="2"> <tr> <td>Subject</td> <td><INPUT NAME="subject" TYPE="TEXT" size=30 MAXLENGTH=50></td> </tr> <tr> <td>Email destinatario</td> <td valign="top"> <INPUT NAME="destinatario" TYPE="TEXT" ALIGN=left size=30 MAXLENGTH=50></td> </tr> <tr> <td valign="top">Testo</td> <td><TEXTAREA NAME="testo" ROWS=7 COLS=42></TEXTAREA></td> </tr> <tr> <td rowspan="3" valign="top">Allega</td> <td><input type="file" name="file1" /></td> </tr> <tr> <td><input type="file" type="file2"/></td> </tr> <tr> <td><input type="file" type="file3"/></td> </tr> <tr> <td colspan="2" align="center"> <table width="50%" border="0" celpadding="6" cellspacing="2"> <tr> <td><input type="submit" name="invio" value=" Invia "></td> <td align="right"> <INPUT TYPE="reset" NAME="reset" VALUE=" Reset "></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </div> </FORM> </BODY> </HTML>
Sul server invece me le carica tutte e tre.
Potete cortesemente aiutarmi?
Grazie in aticipo?
![]()

Rispondi quotando