Saturday, March 31, 2012

sendmail error

Hi there.

I am trying to send an email to a specified valid email address within my asp.net application

I am using the System.web.mail class.

problem is, when it sending the mail using System.Web.Mail.SmtpMail.Send(theEmailObjectHere) it throws me this exception:

"Exception has been thrown by the target of an invocation"

any ideas?

my smtp server does work (using a web smtp provided by a test email address I have made with that service... and they do support smtp!)

exact error message:

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.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) at System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propKey, Object propValue) at System.Web.Mail.LateBoundAccessHelper.SetPropStatic(Object obj, String propName, Object propKey, Object propValue) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at PFTP.createuser.SendEmailRegisterThanks() in c:\inetpub\wwwroot\pftp\createuser.aspx.cs:line 196anyone?
without seeing any code I am going to take a guess - do you have relaying switched on for the virtual smtp server - its on the Access tab under Relay (i think the default is to only allow relaying from certain Ip addresses and there is nothing fiilled in by default).. just pop the IP address of the webserver into the box

0 comments:

Post a Comment