J
Jim
I posted a query about this yesterday, and got a lot of helpful and
useful information back... but it still won't work. For the moment,
I want to send the simplest of email messages, using the
System.Web.Mail.SmtpMail class.... So, here's what't in in my little
ol' console app:
System.Web.Mail.SmtpMail.SmtpServer="smtp.myplace.com";
System.Web.Mail.SmtpMail.Send(
"(e-mail address removed)", "(e-mail address removed)", "test", "This is a test
message!");
According to the docs, if I do not set the SmtpServer property at all,
the mail will be sent with the machine's local SMTP server. It runs
with no errors, but nothing ever happens. I have an SMTP server
running on the local netowrk, which we'll call "myplace.com". When I
set the value of the server, as you see above, my application blows up
with an error... I've disabled all the security on the server and
allowed relaying and all that, just to make sure it easn't SOMETHING
the server was doing... All my email programs work fine... but I can't
make this go no matter WHAT I do!!!! I don't understand this error
message... What am I doing WRONG??? Why won't the MS docs just tell
you waht's wrong? LOL Here is the exception dump that I get:
Unhandled Exception: System.Web.HttpException: Could not access
'CDO.Message' ob
ject. ---> System.Reflection.TargetInvocationException: Exception has
been throw
n by the target of an invocation. --->
System.Runtime.InteropServices.COMExcepti
on (0x80040211): The message could not be sent to the SMTP server. The
transport
error code was 0x80040217. The server response was not available
--- 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, Bind
er binder, Object target, Object[] args, ParameterModifier[]
modifiers, CultureI
nfo culture, String[] namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String method
Name, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String method
Name, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(String from, String to, String
subject, Stri
ng messageText)
at SMTTestContainer.Class1.Main(String[] args) in d:\my
documents\visual stud
io projects\teststuff\smttestcontainer\class1.cs:line 24
Any suggestions? Thanks.
JIM
useful information back... but it still won't work. For the moment,
I want to send the simplest of email messages, using the
System.Web.Mail.SmtpMail class.... So, here's what't in in my little
ol' console app:
System.Web.Mail.SmtpMail.SmtpServer="smtp.myplace.com";
System.Web.Mail.SmtpMail.Send(
"(e-mail address removed)", "(e-mail address removed)", "test", "This is a test
message!");
According to the docs, if I do not set the SmtpServer property at all,
the mail will be sent with the machine's local SMTP server. It runs
with no errors, but nothing ever happens. I have an SMTP server
running on the local netowrk, which we'll call "myplace.com". When I
set the value of the server, as you see above, my application blows up
with an error... I've disabled all the security on the server and
allowed relaying and all that, just to make sure it easn't SOMETHING
the server was doing... All my email programs work fine... but I can't
make this go no matter WHAT I do!!!! I don't understand this error
message... What am I doing WRONG??? Why won't the MS docs just tell
you waht's wrong? LOL Here is the exception dump that I get:
Unhandled Exception: System.Web.HttpException: Could not access
'CDO.Message' ob
ject. ---> System.Reflection.TargetInvocationException: Exception has
been throw
n by the target of an invocation. --->
System.Runtime.InteropServices.COMExcepti
on (0x80040211): The message could not be sent to the SMTP server. The
transport
error code was 0x80040217. The server response was not available
--- 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, Bind
er binder, Object target, Object[] args, ParameterModifier[]
modifiers, CultureI
nfo culture, String[] namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String method
Name, Object[] args)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String method
Name, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(String from, String to, String
subject, Stri
ng messageText)
at SMTTestContainer.Class1.Main(String[] args) in d:\my
documents\visual stud
io projects\teststuff\smttestcontainer\class1.cs:line 24
Any suggestions? Thanks.
JIM