How to use Jmail in c# web application

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
 
B

bruce barker

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)
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top