Hey Rajiv. Our Operations department looked into this, and tested the page in question. They highlighted this line from the full error message:
Code:
VMS.Campaigner.sendmail.btnSubmit_Click(Object sender, EventArgs e) in sendmail.aspx.cs:71
and said:
In sendmail.aspx , FileUpload1.Posted on line 70 is an instance of the HttpPostedFile class. This works on the customer's localhost but not on myhosting.com's server (or any other) because HttpPostedFile.FileName is the
fully-qualified name of the file on the client's computer.
In other words, if
C:\file.txt is uploaded, sendmail.aspx tries to attach that specific file to the email. However, doing so fails because
C:\file.txt doesn't exist on the myhosting.com server.
The customer should:
- Use HttpPostedFile.SaveAs to save the posted file to a temporary file on the server.
- Attach the temporary file to the email.
- Send the email.
- Delete the temporary file.