Sending Mail in C#

  • Thread starter Thread starter Abhishek
  • Start date Start date
A

Abhishek

I have a client list in my addressbook
I have to send all of them mails.
Is there a way in which i can read my addressbook entries and send all of
them a mail
I want all this functionality in C# or vb
f possible can i send a mail directly to a contact group for example i have
created a group with the name of clientlists which has all my clients
grouped together.

Abhishek
 
I basically want to read the my outlook adressbook and pick the addreses
from there.
How can i process this using no third party or external programs.

Abhishek
 
I have a client list in my addressbook
I have to send all of them mails.
Is there a way in which i can read my addressbook entries and send all of
them a mail
I want all this functionality in C# or vb
f possible can i send a mail directly to a contact group for example i have
created a group with the name of clientlists which has all my clients
grouped together.

Abhishek

Hi,

If you are using Outlook you can use Outlook COM interop to access the
address book.

For sending mail you can use the namespace System.Web.Mail.SmtpMail

Hans
 
If you are using Outlook you can use Outlook COM interop to access the
address book.

For sending mail you can use the namespace System.Web.Mail.SmtpMail
can u pls provide more info on this
 
Abhishek said:
[someone else wrote] :
For sending mail you can use the namespace System.Web.Mail.SmtpMail
can u pls provide more info on this

An example of sending a mail message:

using System.Web.Mail;

class Foo
{
public static void Main()
{
MailMessage mess = new MailMessage();
mess.BodyFormat = MailFormat.Text;
mess.To = "jonathan@localhost";
mess.From = "jns@localhost";
mess.Subject = "This is a test";
mess.Body = "This is a test";
SmtpMail.Send(mess);
}
}

You can find more in the documentation at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebmail.asp

/J\
 
Back
Top