How to use Jmail in c# web application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyone

In VB.NET i can use Jmail to send a mai

code
Dim JMai
JMail = Server.CreateObject("JMail.Message"
JMail.silent = Tru
JMail.Logging = Tru
JMail.Charset = "gb2312
JMail.From = "(e-mail address removed)
JMail.FromName = "test
JMail.Subject = "mailtest
JMail.MailServerUserName = "username
JMail.MailServerPassword = "password
JMail.Priority =
JMail.AddRecipient("(e-mail address removed)"
JMail.AddRecipientBCC("(e-mail address removed)"
JMail.HTMLBody = "asssssssssssssss
JMail.Body = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
JMail.Send("mail.server"
JMail.Close(
JMail = Nothin

but i can't use it in c#
please tell me a way to covert these code to c
Any help would be really appreciated

rouro
 
C# does not have builtin support for late binding to native objects much
less com objects. you will need to the System.Runtime.Interop libraries.
Using these libraries is way beyond the scope of a newsgroup post. See
Interoperating with Unmanaged code in the documentation.

It will be easier for you to use typelib importer to build a proxy class
for the com object. if you use VS, just add a reference to the object, other
run the utility and add a reference to the proxy class.


-- bruce (sqlwork.com)
 
Why on earth would you want to use a COM object to do what there are already
managed .Net classes to do? Why not use the System.Web.Mail.SmtpMail class
instead?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top