MailMessage

  • Thread starter Thread starter Jul
  • Start date Start date
J

Jul

Hi,

I use MailMessage class for create email.

I specify such settings:
mmEmail = New MailMessage
mmEmail.To = ".."
mmEmail.Body = "..."
mmEmail.Subject = "..."
mmEmail.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "..."
SmtpMail.Send(mmEmail)

when I get email send by such code, I can not explain the source of "From"
..
How can I check "FROM" property and change it.

This question not for "spam" programming.

Thanks
 
Hi,

The mail message class a from property.
http://msdn.microsoft.com/library/d...lrfsystemwebmailmailmessageclassfromtopic.asp

Ken
------------------------------
Hi,

I use MailMessage class for create email.

I specify such settings:
mmEmail = New MailMessage
mmEmail.To = ".."
mmEmail.Body = "..."
mmEmail.Subject = "..."
mmEmail.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = "..."
SmtpMail.Send(mmEmail)

when I get email send by such code, I can not explain the source of "From"
..
How can I check "FROM" property and change it.

This question not for "spam" programming.

Thanks
 
Hi ,

Thanks for you answers, but I still have a question.
I did not set up "From" property, but it contain value when I get mail.
How that property was set up?
 
Jul,
I'm really not sure what you are asking, what is it set to on the emails you
received?

If its not what you expect, then I would suggest using MailMessage.From to
change it.

Are you using .NET 1.0, 1.1 or the 2.0 beta?

Which OS are you running under?

Are you running under Windows Forms, a Windows Server, or ASP.NET?


FWIW: On .NET 1.1 (VS.NET 2003) on Windows XP SP2 in a Windows Forms, using
Cox for the SmptServer, the From field is required, you receive an exception
if you leave From at the default of Nothing.

Hope this helps
Jay
 
Jul,
What more question:

What are SMTP server are you using? LocalHost, an internal SMTP server, an
external one?

Hope this helps
Jay
 
I use Win 2000 pro
..Net 1.1 - if you need more info about platform I can provide

internal SMTP server - I can not give more information about it, I was just
given "abc.com", so if it is all I know

Sure I can change FROM information as you mentioned previously but it is
interesting the source of my "default" settings

Thansk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top