Google Answers Logo
View Question
 
Q: ASP.NET SmtpMail.Send function does not work ( No Answer,   0 Comments )
Question  
Subject: ASP.NET SmtpMail.Send function does not work
Category: Computers > Programming
Asked by: gattomatto-ga
List Price: $5.00
Posted: 07 Jul 2005 19:52 PDT
Expires: 08 Jul 2005 11:31 PDT
Question ID: 541139
I try to send an email with ASP.NET which should be extremely easy but
it doesn't work and there is no answer anywhere on the net!  Here is
my code:

Dim objMM as New MailMessage()
objMM.To = "foo@example.com" 'my email has been removed for protection
objMM.From = "foo@example.com"
objMM.BodyFormat = MailFormat.Text
objMM.Priority = MailPriority.Normal
objMM.Subject = "Email subject"
objMM.Body = "test"

' I have tried each of the following with no success:
'Specify to use the default Smtp Server
'SmtpMail.SmtpServer = ""
'SmtpMail.SmtpServer = "192.168.1.10"
'SmtpMail.SmtpServer = "Broken"
SmtpMail.SmtpServer = "localhost"

Try
  SmtpMail.Send(objMM)
Catch ex As Exception
  Response.Write(("The following exception occurred: " + ex.ToString()))
  'check the InnerException
  While Not (ex.InnerException Is Nothing)
    Response.Write("--------------------------------")
    Response.Write(("The following InnerException reported: " +     
      ex.InnerException.ToString()))
    ex = ex.InnerException
  End While
End Try

And this code throws the following exceptions:

The following exception occurred:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8007007F): The
specified procedure could not be found.

   --- End of inner exception stack trace ---
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
   at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
   at System.Web.Mail.SmtpMail.Send(MailMessage message)
   at ASP.scavenger_aspx.Submit_Click(Object objSender, EventArgs
objEArgs) in c:\inetpub\wwwroot\rock-n-rave\scavenger.aspx:line
55--------------------------------The following InnerException
reported: System.Runtime.InteropServices.COMException (0x8007007F):
The specified procedure could not be found.

I think it's maybe something like a simple DLL installation issue. 
Could be wrong!  I'm running ASP.NET version 1.1 on Windows 2000.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy