tags:

views:

12

answers:

1

How to send the email through mine company email id

Like every company use to give some email id to its associates like [email protected]

How to send the mails through this id to other accounts. Also I don't have passwords for this id, then how to send the email in this situation.

A: 

You could use the SmtpClient class. Other than the from and to addresses you will need your company's SMTP server:

var message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "This is the Subject";
message.From = new MailAddress("[email protected]");
message.Body = "body of the mail";
using (var smtpClient = new SmtpClient("smtp.abc.com"))
{
    smtpClient.Send(message);
}
Darin Dimitrov
'you will need your company's SMTP server' - and probably a user id and password for that SMTP server
Tim Robinson
@Tim, the OP mentioned Outlook, so I assumed Exchange server which usually is configured using integrated windows authentication so in this case it won't be necessary but of course it's an assumption. Good point.
Darin Dimitrov
@Darin you are correct
Nits