Display Name not showing up in Outlook for FROM Addresses

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ksgsharma
    New Member
    • Sep 2011
    • 2

    Display Name not showing up in Outlook for FROM Addresses

    Hi,

    I m creating a mail object and setting the FROM address to it as follows:

    MailMessage objMail = new MailMessage();
    objMail.From = new MailAddress("Te stFrom@gmail.co m");

    When I look at the mail in OutLook, display name is not set for FROM address. It always shows the complete email ID. But for TO and CC addresses, display names are showing up correctly. (My Outlook has all display names configured, since it is showing up display name for TO addresses)

    objMail.To.Add( new MailAddress("Te stMail@gmail.co m"));

    Is there something different between FROM and TO addresses I m missing.

    Please Help !! Urgent !!
  • PianoMan64
    Recognized Expert Contributor
    • Jan 2008
    • 374

    #2
    Hey ksgsharma,

    I have a few questions about how you're sending the email:

    1. Are you having the application send an email using a Network resource (i.e. Exchange) or are you sending email using POP3 or some account that you're logging into (i.e. GMAIL.COM using POP3 access with username and password.)

    2. if you are using Exchange, It doesn't care nor will it try to resolve the name for you when you send an email using Exchange to an email account. It will display it as you type it in your .FROM property. If you want it to display a certain way, then you need to format your string value to be "<DISPLAY NAME>email@doma inname.com".

    3. if you are sending from POP3 account to another email, You will have to employ the same method mentioned in option 2 in order to send your emails with a display name.

    Hope that helps,

    Code:
    objMail.From = new MailAddress("<DisplayName>EmailAddress@domain.com");

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      If you create the email in outlook (not in code) and change the from address, does it use the display name or full email name?

      Comment

      • ksgsharma
        New Member
        • Sep 2011
        • 2

        #4
        Thanks guys .. I used this to resolve the issue:

        objMail.From = new MailAddress("<D isplayName>Emai lAddress@domain .com");

        Sorry for delayed response.

        Comment

        Working...