The "SendUsing" configuration value is invalid.http://forums.asp.net/t/1769429.aspx/1?The+SendUsing+configuration+value+is+invalid+Tue, 14 Feb 2012 14:55:35 -050017694294831724http://forums.asp.net/p/1769429/4831724.aspx/1?The+SendUsing+configuration+value+is+invalid+The "SendUsing" configuration value is invalid. <p>Hi Everyone,</p> <p>I am using .NET 4.0 and IIS 7.5 to send an email using below code</p> <pre class="prettyprint">Private Sub SendMail() Dim strQuery As New StringBuilder Dim mail As New MailMessage() strQuery.AppendLine(&quot;Dear sir,&quot;) strQuery.AppendLine(&quot;Below given events are failed to process in the portal. &quot;) mail.From = &quot;webmaster@xxx.com&quot; mail.To = &quot;shabbir@xxx.com&quot; mail.Subject = &quot;Test&quot; mail.Body = Convert.ToString(strQuery.ToString()) mail.BodyFormat = MailFormat.Text 'Specify to use the default Smtp Server SmtpMail.SmtpServer = &quot;&quot; 'Now, to send the message, use the Send method of the SmtpMail class SmtpMail.Send(mail) End Sub</pre> <p>Previously On iis6.0 it was working fine but on IIS 7.5 it display below error, Could anyone help me</p> <p></p> <p></p> <h2><i>The &quot;SendUsing&quot; configuration value is invalid.<br> </i></h2> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><b>Description: </b>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. <br> <br> <b>Exception Details: </b>System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: The &quot;SendUsing&quot; configuration value is invalid.<br> <br> <br> <b>Source Error:</b> </span></p> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><br> </span></p> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif"><br> </span></p> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif">Thanks in Advance</span></p> <p><span face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif " style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif">Shabbir<br> <br> </span></p> 2012-02-14T13:43:32-05:004831775http://forums.asp.net/p/1769429/4831775.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p></p> <blockquote><span class="icon-blockquote"></span> <h4>shabbir_215</h4> 'Specify to use the default Smtp Server SmtpMail.SmtpServer = &quot;&quot; </blockquote> <p></p> <p>Could the fact you didn't specify your email server be the issue??? Unless you left this intentionally blank.</p> 2012-02-14T14:10:50-05:004831813http://forums.asp.net/p/1769429/4831813.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p>I have left it blank only because it was working fine previoulsy, I don't have to define SMTP server.</p> 2012-02-14T14:30:13-05:004831837http://forums.asp.net/p/1769429/4831837.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p>Actually in your code you do need to somewhere, even if you define it in your web config, the smtpserver has to be specified unless you are using some email helper class that you've coded.</p> 2012-02-14T14:41:50-05:004831843http://forums.asp.net/p/1769429/4831843.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p>But as i said it was not required to Specify when using IIS6.0 so please let me know where should i specify smtp server</p> 2012-02-14T14:45:00-05:004831848http://forums.asp.net/p/1769429/4831848.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p>IIS 6 is usually much more forgiving about this since you probably had the smtp server on the local server. Can you post your web config file???</p> 2012-02-14T14:47:54-05:004831861http://forums.asp.net/p/1769429/4831861.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <pre class="prettyprint">&lt;system.net&gt; &lt;mailSettings&gt; &lt;smtp from=&quot;webmaster@xxx.com&quot;&gt; &lt;network host=&quot;localhost&quot; /&gt; &lt;/smtp&gt; &lt;/mailSettings&gt; &lt;/system.net&gt;</pre> 2012-02-14T14:52:29-05:004831865http://forums.asp.net/p/1769429/4831865.aspx/1?Re+The+SendUsing+configuration+value+is+invalid+Re: The "SendUsing" configuration value is invalid. <p>Ok, comment out the SmtpMail.SmtpServer. You are overriding what is in your web config.</p> 2012-02-14T14:55:35-05:00