Imar:
Thank you for your quick response.
To answer your questions from your email to me:
Is this the actual code you're executing?
No
Or did you modify the addresses before you posted here?
Modified the addresses.
From my email.aspx file:
public partial class Email : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
MailMessage myMessage = new MailMessage();
myMessage.Subject = "Greetings";
myMessage.Body = "Hello world, from Planet Wrox";
myMessage.From = new MailAddress("[email protected]", "Gay");
myMessage.To.Add(new MailAddress("[email protected]", "Gay Farace-Mann"));
SmtpClient mySmtpClient = new SmtpClient();
mySmtpClient.EnableSsl = false;
mySmtpClient.Send(myMessage);
}
}
The current addresses seem fine to me, so those shouldn't be a problem. The error you get is typically thrown when you enter an invalid To or From address, like "you" instead of
[email protected].
And how does your <system.net /> element in web.config look?
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="gay-faracemann<@cox.net>">
<network host="smtp.west.cox.net" userName="gay-faracemann" password="Boysare2!"/>
</smtp>
</mailSettings>
</system.net>
v/r,
gfmann