Problem sending emails.

Discussion in 'ASP.NET 2.0' started by lloydphillips, Sep 23, 2007.

  1. I'm having problems with an asp.net 1.1 application. It used to work fine but has only begun since moving to discountasp. Whenever an email is trying to be sent from the application I am getting the following error:


    Server Error in '/' Application. </o:p>



    The "SendUsing" configuration value is invalid.</o:p>
    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.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.


    Source Error: </o:p>




    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. </o:p>

    Stack Trace: </o:p>




    </o:p>
    [COMException (0x80040220): The "SendUsing" configuration value is invalid.</o:p>
    ]</o:p>
    </o:p>
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]</o:p>
    System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0</o:p>
    System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2453568</o:p>
    System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +72</o:p>
    </o:p>
    [HttpException (0x80004005): The "SendUsing" configuration value is invalid.</o:p>
    ]</o:p>
    System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +119</o:p>
    System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1955</o:p>
    System.Web.Mail.SmtpMail.Send(MailMessage message) +131</o:p>
    KickAdmin.email.SendEmail(String message, String toemail, String fromemail, String subject) +236</o:p>
    KickAdmin.email.SendOrderStatusEmail(Int32 oid, String status, String email, String uid, String fname) +125</o:p>
    KickAdmin.order.ddlStatus_SelectedIndexChanged(Object sender, EventArgs e) +295</o:p>
    System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +105</o:p>
    System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134</o:p>
    System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +7</o:p>
    System.Web.UI.Page.RaiseChangedEvents() +137</o:p>
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4778</o:p>

    I've checked on the web a few weeks ago and it suggested that it was a problem with the routing to the default server. I've checked all mysettings and they look good to me. I just can't figure this out. This is the send method I am using:

    Dim objMailMessage As MailMessage
    objMailMessage = New MailMessage
    objMailMessage.UrlContentBase = "domain/images"
    objMailMessage.UrlContentLocation = "domain"
    objMailMessage.From = fromemail
    objMailMessage.To = toemail
    'objMailMessage.To ="domain"
    objMailMessage.Subject = subject
    objMailMessage.Body = message
    objMailMessage.BodyFormat = MailFormat.Html
    SmtpMail.SmtpServer = "localhost"
    SmtpMail.Send(objMailMessage)
    'Label1.Text = "Email Sent"


    Anyone got any ideas where I am going wrong?

    Lloyd
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Lloyd,


    this error is almost always caused by an invalid SMTP server. Are you sure you are using "localhost" as the SMTP server? Is this application running on our server?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I'm having troubles as well sending email from a web app of mine.

    Works great at home but not at discount asp.

    I'm sure it's a simple configuration error on my end but I'm not seeing anything in the knowledge base on correct settings.

    Reading the previous post, should I be using "localhost" for my smtp server or the designated SMTP server for my domain "smtp.mn4wda.com"?

    This wasn't clear to me.

    Frenchy
     
  4. Problem solved... Localhost is what to use.

    Frenchy
     

Share This Page