Thursday, March 29, 2012

MailMessage Question

I have built a form and the necessary code to process the form to send in a MailMessage Obj... here...


strMessage = "Message Text";

MailMessage objMailMessage = new MailMessage();
objMailMessage.From = txtEmail.Text;
objMailMessage.Subject = "Maytag Contact Information";
objMailMessage.To = "mindreactor@dotnet.itags.org.gish.com";
objMailMessage.Body = strMessage;
objMailMessage.Priority = MailPriority.High;

SmtpMail.Send(objMailMessage);

Of course it works great but when I change the .To to the proper address, it doesn't take it... do I have to recompile something or other, destroy the MailMessage Object, what? IT works fine on my test server and when I upload to the main server works fine too... its just when I change the To and reupload, still sends to the old address...

any help would be appreciated...

AarronOnce you made any changes you need to recompile it again.

Hope it helps !!
Okay, total newbie question then...

but I also assumd VS handled all of the recompilation before hand... is the Build option what recompiles?

Thanks,

Aarron
yup the build option or offcourse the rebuild option
as a general rule of thumb ive found with vs.net- if you change soemthing in the design, in the .aspx page, you can just save and you will be fine, but if you change somehting in any of the code or code-behind, like the .cs or .aspx.cs, you have to rebuild

0 comments:

Post a Comment