Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Sending emails with asp.net

Posted on 2011-09-15
Medium Priority
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("noreply@mywebsite.com")

It looks really bad when receiving a message from "noreply@mywebsite.com". My question is, how can I do for the user to receive the message from noreply@mywebsite.com 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("noreply@mywebsite.com")
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 41

Accepted Solution

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

   msg.From = new MailAddress("noreply@mywebsite.com", "Display Name")

LVL 19

Assisted Solution

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

    Dim addrFrom As MailAddress = New MailAddress("noreply@mywebsite.com", "Mywebsite Support")
    Dim myTo As MailAddress = New MailAddress("steve@contoso.com", "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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 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