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

x
?
Solved

Sending emails with asp.net

Posted on 2011-09-15
4
Medium Priority
?
320 Views
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?

Thanks!
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.To.Add(RS(6))
msg.Subject = "New Appointment Request"
msg.Body = email
smtp.Host = "xx.xx.xx.xx"
smtp.Port = 25
smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtp.Send(msg)
smtp.Dispose()

Open in new window

0
Comment
Question by:pvg1975
[X]
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
4 Comments
 
LVL 41

Accepted Solution

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

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

0
 
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 
    myMessage.To.Add(myTo)

Open in new window

0
 
LVL 7

Expert Comment

by:mr_nadger
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.
0
 

Author Closing Comment

by:pvg1975
ID: 36549368
Thanks!
0

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