Sending emails with

Posted on 2011-09-15
Last Modified: 2012-05-12
Hello all,

Im using the attached code code to send an email.

Please notice the line

Dim addrFrom As New System.Net.Mail.MailAddress("")

It looks really bad when receiving a message from "". My question is, how can I do for the user to receive the message from but see something like "Mywebsite Support" as the name of the sender?

Dim msg As New System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient
Dim addrFrom As New System.Net.Mail.MailAddress("")
msg.From = addrFrom
msg.Subject = "New Appointment Request"
msg.Body = email
smtp.Host = "xx.xx.xx.xx"
smtp.Port = 25
smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network

Open in new window

Question by:pvg1975
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 40

Accepted Solution

Kyle Abrahams earned 300 total points
ID: 36545012
            MailMessage x = new MailMessage();
            x.From = new MailAddress("", "Test This");

   msg.From = new MailAddress("", "Display Name")

LVL 19

Assisted Solution

by:Manoj Patil
Manoj Patil earned 200 total points
ID: 36545351
Dim myMessage As New MailMessage

    Dim addrFrom As MailAddress = New MailAddress("", "Mywebsite Support")
    Dim myTo As MailAddress = New MailAddress("", "Steve Miller")

    myMessage.From = addrFrom 

Open in new window


Expert Comment

ID: 36547777
rather than spoofing the from address, which will be picked up by some email hosts (which happened to me when writing an asp email system), try using the reply to option instead.

Author Closing Comment

ID: 36549368

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question