Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: How to utilize the SMTP Service in aspx!


Message #1 by Anders Lundholm <alu@m...> on Wed, 8 Nov 2000 15:25:50 +0100
Hello again (Frederik are you still with me?!)



I was wondering how one could actually send e-mails from an aspx page 

using

the .net runtime framework. In the oldschool regular asp world, one 

would

instantiate a "cdonts.newmail" object  (or using the excellent jmail

component, for instance) and use that as a connection to a smtp server 

(the

former would often be a local smtp server).



The docs doesn't say much about smtp services so I figure I'd have to 

use

the good old COM object in order to send e-mails from aspx pages?! Or

perhaps I should write the plumbing myself (using the System.Net 

assembly

which would be cumbersome) !?



Thanks in advance!



With regards

Anders Lundholm =B7 lundholm@m... =B7 www.mondo.dk

Graphics Design =B7 Web Development =B7 HandCrafted Code (tm)

--

http://www.sphereworx.com [sphere =B7 worx]

Message #2 by "Fredrik Normen" <fredrik.normen@e...> on Thu, 09 Nov 2000 07:34:12 +0100
It=27s simple to doing this in asp+=2E

You use the smtpmail and mailmessage classes from the System=2EWeb=2EUtil

 



namespace=2E

You need to install/setup a Virtual SMTP Server in the Internet Service 



Manager=2E



After this you simple write=3A



objMail =3D New smtpmail

ObjMessage =3D New MailMessage



ObjMessage=2EFrom =3D =22Fredrik=22

ObjMessage=2ETo =3D =22fredrik=2Enormen=40endero=2Ecom=22

ObjMessage=2ESubject =3D =22My subject=22

ObjMessage=2EBodyFormat =3D 1

Dim strBodyMail =3D =22I=27ve got mail=22



ObjMessage=2EBody =3D strBodyMail

objMail=2Esend(ObjMessage)



I hope this will help you=2E



/Fredrik Normen









----- Original Message -----

From=3A Anders Lundholm =3Calu=40mondo=2Edk=3E

Date=3A Wednesday=2C November 8=2C 2000 3=3A25 pm

Subject=3A =5Baspx=5D How to utilize the SMTP Service in aspx!



=3E Hello again (Frederik are you still with me=3F!)

=3E 



=3E I was wondering how one could actually send e-mails from an aspx 



=3E page using

=3E the =2Enet runtime framework=2E In the oldschool regular asp world=2C

 



=3E one would

=3E instantiate a =22cdonts=2Enewmail=22 object  (or using the excellent 

jmail

=3E component=2C for instance) and use that as a connection to a smtp 



=3E server (the

=3E former would often be a local smtp server)=2E

=3E 



=3E The docs doesn=27t say much about smtp services so I figure I=27d hav

e 



=3E to use

=3E the good old COM object in order to send e-mails from aspx pages=3F! 

Or

=3E perhaps I should write the plumbing myself (using the System=2ENet 



=3E assemblywhich would be cumbersome) !=3F

=3E 



=3E Thanks in advance!

=3E 



=3E With regards

=3E Anders Lundholm =B7 lundholm=40mondo=2Edk =B7 www=2Emondo=2Edk

=3E Graphics Design =B7 Web Development =B7 HandCrafted Code (tm)

=3E --

=3E http=3A//www=2Esphereworx=2Ecom =5Bsphere =B7 worx=5D

=3E 



Message #3 by "Roger M. Taylor" <rogertaylor@f...> on Wed, 08 Nov 2000 23:41:58 -0500
http://www.aspfree.com/asp+/demos/email.aspx

has the code to do so.



At 03:25 PM 11/8/2000 +0100, you wrote:

>Hello again (Frederik are you still with me?!)

>

>I was wondering how one could actually send e-mails from an aspx page using

>the .net runtime framework. In the oldschool regular asp world, one would

>instantiate a "cdonts.newmail" object  (or using the excellent jmail

>component, for instance) and use that as a connection to a smtp server (the

>former would often be a local smtp server).

>

>The docs doesn't say much about smtp services so I figure I'd have to use

>the good old COM object in order to send e-mails from aspx pages?! Or

>perhaps I should write the plumbing myself (using the System.Net assembly

>which would be cumbersome) !?

>

>Thanks in advance!

>

>With regards

>Anders Lundholm =B7 lundholm@m... =B7 www.mondo.dk

>Graphics Design =B7 Web Development =B7 HandCrafted Code (tm)

>--

>http://www.sphereworx.com [sphere =B7 worx]

>

Message #4 by danielw@w... on Thu, 9 Nov 2000 08:13:00 -0000
Christophe Wille has one of the most comprehensive articles on this, at

http://www.aspheute.com/english/20000918.asp



Daniel Walker

Wrox Press



> Hello again (Frederik are you still with me?!)

> 

> I was wondering how one could actually send e-mails from an aspx page 

> using

> the .net runtime framework. In the oldschool regular asp world, one 

> would

> instantiate a "cdonts.newmail" object  (or using the excellent jmail

> component, for instance) and use that as a connection to a smtp server 

> (the

> former would often be a local smtp server).

> 

> The docs doesn't say much about smtp services so I figure I'd have to 

> use

> the good old COM object in order to send e-mails from aspx pages?! Or

> perhaps I should write the plumbing myself (using the System.Net 

> assembly

> which would be cumbersome) !?

> 

> Thanks in advance!

> 

> With regards

> Anders Lundholm =B7 lundholm@m... =B7 www.mondo.dk

> Graphics Design =B7 Web Development =B7 HandCrafted Code (tm)

> --

> http://www.sphereworx.com [sphere =B7 worx]


  Return to Index