none
Sending mail to group email address of outlook RRS feed

  • Question

  • Hi All, 

    how shall i send mail to group mail address of outlook from my local SMTP server. any suggestion or guidance will be helpfull. 

    Tuesday, May 7, 2019 4:20 AM

All replies

  • A group email as in an Outlook group can only be done via Outlook client. If you're instead referring to an email alias/distribution list that someone set up on the mail server to allow you to notify a group of people then that will have a regular email like everybody else. You just send the email using SmtpClient to that email and it will handle sending to everyone.

    Michael Taylor http://www.michaeltaylorp3.net

    Tuesday, May 7, 2019 3:23 PM
    Moderator
  • Hi Basavaprabhu.t,

    Thank you for posting here.

    Based on your description, you want to send email to group email address of outlook form your local smtp server.

    You could try the following code, please pay attention to the bold code.

                    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
                    MailAddress from = new MailAddress("chintan.desai@xxx.com", "Chintan...");
                    message.From = from;
                    message.To.Add("chintan.desai@xxx.com,outlook_group");
                    message.Subject = "Subject";
                    message.Body = "Body";
    
                    System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("mail.xxx.com");
                    client.Credentials = new  System.Net.NetworkCredential("fromEmailID","PasswordOftheFromEmailID");
    
                    client.Send(message);

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, May 8, 2019 1:45 AM
    Moderator