Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HELP: Sending mail (Error)

Reply
Thread Tools

HELP: Sending mail (Error)

 
 
VB Programmer
Guest
Posts: n/a
 
      01-22-2004
I am trying to send a simple email through my ASP.NET website. This is how
I do it.
Try
System.Web.Mail.SmtpMail.Send(" om",
"", "test", "TESTING 123")
Catch ex As Exception
Response.Write(ex.ToString)
End Try
Exit Sub

I get this error:
"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 (0x80040220): The "SendUsing"
configuration value is invalid.

--- 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)
--- End of inner exception stack trace ---
at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject 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 POWERWeb.TestCode.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\POWERWeb\TestCode.aspx.vb:line 36"

Any ideas? Thanks.


 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      01-22-2004
Hi VB programmer,

This sample I made once for someone from Polen.
wiadomosc=message

I hope this helps?

Cor

\\\
Dim wiadomosc As Web.Mail.MailMessage = New Web.Mail.MailMessage
Dim config As MailAttachment = New
MailAttachment("c:\test.txt")
wiadomosc.Attachments.Add(config)
wiadomosc.From = xxx@xxx
wiadomosc.To = xxx@xxx
wiadomosc.Subject = "..."
wiadomosc.Body = "..."
wiadomosc.BodyFormat = Web.Mail.MailFormat.Text
System.Web.Mail.SmtpMail.SmtpServer = "xxxx.xxxx.xx"
System.Web.Mail.SmtpMail.Send(wiadomosc)
///




> I do it.
> Try
> System.Web.Mail.SmtpMail.Send(" om",
> "", "test", "TESTING 123")
> Catch ex As Exception
> Response.Write(ex.ToString)
> End Try
> Exit Sub
>



 
Reply With Quote
 
 
 
 
VB Programmer
Guest
Posts: n/a
 
      01-22-2004
I tried it and got the same error.

I used "localhost" as the SmtpServer. Is this the right thing to do? Is
the "Default SMTP Virtual Server" in ISM the only thing that needs to be
running? Any ideas?

Thanks.

"Cor" <> wrote in message
news:%...
> Hi VB programmer,
>
> This sample I made once for someone from Polen.
> wiadomosc=message
>
> I hope this helps?
>
> Cor
>
> \\\
> Dim wiadomosc As Web.Mail.MailMessage = New Web.Mail.MailMessage
> Dim config As MailAttachment = New
> MailAttachment("c:\test.txt")
> wiadomosc.Attachments.Add(config)
> wiadomosc.From = xxx@xxx
> wiadomosc.To = xxx@xxx
> wiadomosc.Subject = "..."
> wiadomosc.Body = "..."
> wiadomosc.BodyFormat = Web.Mail.MailFormat.Text
> System.Web.Mail.SmtpMail.SmtpServer = "xxxx.xxxx.xx"
> System.Web.Mail.SmtpMail.Send(wiadomosc)
> ///
>
>
>
>
> > I do it.
> > Try
> > System.Web.Mail.SmtpMail.Send(" om",
> > "", "test", "TESTING 123")
> > Catch ex As Exception
> > Response.Write(ex.ToString)
> > End Try
> > Exit Sub
> >

>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      01-22-2004
Hi,

Do you have a IIS smtp mailserver running on that localhost.
If you have you also can than try 127.0.0.1

Cor
> I used "localhost" as the SmtpServer. Is this the right thing to do? Is
> the "Default SMTP Virtual Server" in ISM the only thing that needs to be
> running? Any ideas?



 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      01-22-2004
"Cor" <> wrote in news::
> Do you have a IIS smtp mailserver running on that localhost.
> If you have you also can than try 127.0.0.1


127.0.0.1 IS localhost.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com

 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      01-22-2004
Hi Chad,

>127.0.0.1 IS localhost.


Thanks that you tell me that

And you are sure that you can use LOCALHOST everywhere?

Cor


 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      01-22-2004
"Cor" <> wrote in news::
>>127.0.0.1 IS localhost.

>
> Thanks that you tell me that
>
> And you are sure that you can use LOCALHOST everywhere?


Anywhere that you want to use 127.0.0.1 - except on Win95 B which has a bug
with it, but you wont be running .net there anwyays.

But you still have to have a SMTP server running.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com

 
Reply With Quote
 
Charlie@CBFC
Guest
Posts: n/a
 
      01-22-2004
I get same problem. Never been able to figure it out. If all else fails,
you can set SMTP property to your ISP's SMTP server. This is what I did.

Charlie
"Chad Z. Hower aka Kudzu" <> wrote in message
news:Xns9478D14CED148cpub@127.0.0.1...
> "Cor" <> wrote in news::
> >>127.0.0.1 IS localhost.

> >
> > Thanks that you tell me that
> >
> > And you are sure that you can use LOCALHOST everywhere?

>
> Anywhere that you want to use 127.0.0.1 - except on Win95 B which has a

bug
> with it, but you wont be running .net there anwyays.
>
> But you still have to have a SMTP server running.
>
>
> --
> Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
> "Programming is an art form that fights back"
>
>
> ELKNews - Get your free copy at http://www.atozedsoftware.com
>



 
Reply With Quote
 
=?Utf-8?B?dmFnem9uZQ==?=
Guest
Posts: n/a
 
      02-04-2004
These codes are working without error message.. But I didn't get email.. Is that really working or not?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 HoustonComputerGuy@gmail.com ASP .Net 4 09-28-2007 03:57 PM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
Sending Mail via System.Net.Mail problem =?Utf-8?B?T3Bh?= ASP .Net 3 01-31-2006 06:44 PM
Sending e-mail with attachments with the default e-mail client =?ISO-8859-1?Q?Andr=E9s_Berenguer?= Java 0 08-29-2003 02:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57