Why do I get the error message ‘CS0122: ‘System.Drawing.Imaging.ImageFormat.jpeg’ is inaccessible due to its protection level ‘
Try giving the proper file path for the image. Also make sure you have proper permissions on that file.
Why do I get the error message ‘Sender address rejected: need fully-qualified address ‘
This is happening because your SmtpMail.SmtpServer is rejecting addresses. To resolve this make sure all email addresses specified at MailMessage.To, MailMessage.Cc, MailMessage.Bcc and MailMessage.From are valid email addresses you have permissions to relay through the server. MailMessage.From has permissions to relay through the server
How can I specify multiple recipients for a message?
Seperate each recipient with a semicolon (;) in the mailMessage.To property: VB.NET mailMessage.To = ‘[email protected];[email protected]’ C# mailMessage.To = ‘[email protected];[email protected]’;
Why do I get the error message ‘The transport failed to connect to the server ‘
This is a network related error. Your application cannot connect to the mail server specified. Make sure that the following are true about SmtpMail.SmtpServer: Is a valid SMTP Server Make sure that the server System.Web.Mail is running or can connect to the mail server. Some times firewalls or proxy servers can get in the way. Try specifying the value by IP address. Poor DNS resolution can sometimes hinder name lookups. Make sure that the mail server is running at port 25. If you did not specify a SmtpMail.SmtpServer property, or if SmtpMail.SmtpServer points to ‘localhost’ (or the equivalent), be sure the SMTP Service is running on port 25. For testing purposes change the MailMessage.From and MailMessage.To properties to an address that exists on SmtpMail.SmtpServer. Some times this exception is thrown, when it really is a relay issue.
How can I cache the page by the complete querystring
Try the following: <%@ OutputCache Duration=’10’ VaryByParam=’*’ %> This should result in any changes to querystring parameters causing a new version of the page to be cached. Keep in mind that this can significantly increase the amount of memory used for caching, depending on how many querystring parameters you’re using. Note: ‘*’ is not recommended – it is best to use a list of params that your page truly varies by.