>ciao
Ciao!
>allora l'errore che mi esce è il seguente:
>
>Invalid mail attachment 'C:\'.
>Description: An unhandled exception occurred during the execution
>of the current web request. Please review the stack trace for
>more information about the error and where it originated in the
>code.
>
>Exception Details: System.Web.HttpException: Invalid mail attachment
>'C:\'.
>
>Source Error:
>
>
>Line 30: Mail.SmtpMail.SmtpServer = "smtp.sitoweb.com"
>Line 31:
>Line 32: Dim attachment As New Mail.MailAttachment("C:\")
>Line 33: ' Aggiungo l'allegato all'email
>Line 34: mailMessage.Attachments.Add(attachment)
>
>
>Source File: D:\Inetpub\webs\sitoweb\Lavora con noi.aspx Line:
>32
Ma scusa, l'errore è normalissimo...l'argomento in MailAttachment ovvero "C:\" non punta a nessun file....piuttosto dovresti effettuare dei controlli sul percorso ed eventualmente inserire l'allegato!
Invalid mail attachment 'C:\'.
Guarda il tuo stesso codice in C#, effettuavi questa operazione
string strdir = "D:\\temp\\";
string strfilename = Path.GetFileName(txtFile.PostedFile.FileName);
...
...
msg.Attachments.Add(new MailAttachment(strdir + strfilename))
Ovvero inserivi come argomento directory + filename!
------------------------------------------
Ignazio Catanzaro
http://blogs.dotnethell.it/swdev/