A
Andrei Suvorov
Hello,
Can anyone suggest how to handle th following problem:
1. I've changed userName and password attributes in <processModel> in
machine.config to make aspnet_wp.exe run under my local account.
2. But now the following code in my .aspx fails with exception:
using System.Web.Mail;
SmtpMail.SmtpServer = "mymailhost";
SmtpMail.Send("(e-mail address removed)", "(e-mail address removed)","test 2", "test message");
Exception:
System.Web.HttpException: Could not access 'CDO.Message' object. --->
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80040213): The transport
failed to connect to the server.
--- 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.CallMethod(Type type, Object
obj, String methodName, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
subject, String messageText)
at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
String messageText)
at TestMail1._Default.ButtonSend_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\testmail1\default.aspx.cs:line 54
Any suggestions would be thankfully appreciated.
Regards,
Andrei Suvorov.
Can anyone suggest how to handle th following problem:
1. I've changed userName and password attributes in <processModel> in
machine.config to make aspnet_wp.exe run under my local account.
2. But now the following code in my .aspx fails with exception:
using System.Web.Mail;
SmtpMail.SmtpServer = "mymailhost";
SmtpMail.Send("(e-mail address removed)", "(e-mail address removed)","test 2", "test message");
Exception:
System.Web.HttpException: Could not access 'CDO.Message' object. --->
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80040213): The transport
failed to connect to the server.
--- 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.CallMethod(Type type, Object
obj, String methodName, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
subject, String messageText)
at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
String messageText)
at TestMail1._Default.ButtonSend_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\testmail1\default.aspx.cs:line 54
Any suggestions would be thankfully appreciated.
Regards,
Andrei Suvorov.