我正在开发visual studio 2012 vb.net编码。我被要求为我的公司创建一个向客户发送电子邮件的应用程序,但他们希望在客户的屏幕上显示公司名称,并且应该隐藏电子邮件地址。我的代码工作正常,除了这一点(隐藏发件人地址),我正在使用smtp客户端。 任何提示?
以下是我的代码:
Dim mail As New MailMessage()
'mail.From = New MailAddress("Me@domain.com", "Me")
mail.From = New MailAddress("""Me "" <Me@domain.com>")
mail.[To].Add("somebody@domain.com")
mail.Subject = "Test email from App"
mail.Body = "Dear somebody, this email was sent from our project as a test email, Regards."
Dim smtp As New SmtpClient("localhost")
Try
nsmtp.Send(mail)
Response.Write("Your Email has been sent sucessfully - Thank You")
Catch exc As Exception
Response.Write("Send failure: " & exc.ToString())
End Try