Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. SmtpMail.Send(msg) problem

SmtpMail.Send(msg) problem

Scheduled Pinned Locked Moved ASP.NET
helpworkspacecomdesigndata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asim N
    wrote on last edited by
    #1

    hello, here is the code am using , trying to send a mail. am sitting in a networked environment. MailMessage msg = new MailMessage(); msg.To="anazir@xavor.com.pk"; msg.From="ASIM"; msg.Body="aoa"; SmtpMail.Send(msg); this is the error on pressing button, for sending mail. The "SendUsing" configuration value is invalid. 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: Line 62: string subject = "UtilMailMessage001"; Line 63: string body = "UtilMailMessage001 - success"; Line 64: SmtpMail.Send(from, to, subject, body); Line 65: Line 66: Source File: c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs Line: 64 Stack Trace: [COMException (0x80040220): The "SendUsing" configuration value is invalid. ] [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0 System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29 System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args) System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) [HttpException (0x80004005): Could not access 'CDO.Message' object.] System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) System.Web.Mail.CdoSysHelper.Send(MailMessage message) System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject, String messageText) System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) mailapplication.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs:64 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHand

    L 1 Reply Last reply
    0
    • A Asim N

      hello, here is the code am using , trying to send a mail. am sitting in a networked environment. MailMessage msg = new MailMessage(); msg.To="anazir@xavor.com.pk"; msg.From="ASIM"; msg.Body="aoa"; SmtpMail.Send(msg); this is the error on pressing button, for sending mail. The "SendUsing" configuration value is invalid. 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: Line 62: string subject = "UtilMailMessage001"; Line 63: string body = "UtilMailMessage001 - success"; Line 64: SmtpMail.Send(from, to, subject, body); Line 65: Line 66: Source File: c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs Line: 64 Stack Trace: [COMException (0x80040220): The "SendUsing" configuration value is invalid. ] [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0 System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473 System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29 System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args) System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) [HttpException (0x80004005): Could not access 'CDO.Message' object.] System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) System.Web.Mail.CdoSysHelper.Send(MailMessage message) System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject, String messageText) System.Web.Mail.SmtpMail.Send(String from, String to, String subject, String messageText) mailapplication.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\mailapplication\webform1.aspx.cs:64 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHand

      L Offline
      L Offline
      Loki
      wrote on last edited by
      #2

      Its probably can't find an SMTP Server to communicate with. Try setting the SmtpMail.SmtpServer to the name of your smtp server, eg. SmtpMail.SmtpServer = "mailserver"; Grant @ Loki

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups