Thanks a lot Alvin. I posted this message in aspnet, csharp groups also. You
are the only one to reply. Thanks once again.
I replaced the ipaddress with localhost and I recieved the following error
and inner exception.
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(T ype type, Object obj,
String methodName, Object[] args) at
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args)
Is being behind an ADSL router the cause for this error?
Regards,
Srinivas
"Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:ul**************@TK2MSFTNGP10.phx.gbl...
replace the ipaddress with "localhost", that should fix it.
--
Regards,
Alvin Bruney - ASP.NET MVP
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"Srinivas" <no*****@email.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl... Hi,
I am using ASP.NET SmtpMail to send email using the following code
public void SendEmail(string From, string To, string Subject,
StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.From = From;
mailMessage.To = To;
mailMessage.Subject = Subject;
mailMessage.Body = Message.ToString ();
if(mailFormat == "T")
{
mailMessage.BodyFormat = MailFormat.Text;
}
else if(mailFormat == "H")
{
mailMessage.BodyFormat = MailFormat.Html;
}
SmtpMail.SmtpServer = "10.0.0.1";
SmtpMail.Send (mailMessage);
}
This code executes fine without error. But the email goes and sits in
the "C:\Inetpub\mailroot\Queue" folder.
SMTP service is running and cdosys.dll and cdonts.dll are installed.
My computer is connected to the internet through a Speedtouch 545 ADSL
router. I got the "10.0.0.1" by doing the ipconfig at command prompt.
Can anyone please guide me in the right direction.
Thanks,
Srinivas