Hello,
When I try to run the E-mail.aspx.cs, I run into this error:
The remote name could not be resolved: 'smtp.zanestate.edu'
Here is my Code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
public partial class Demos_Email : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
MailMessage myMessage = new MailMessage();
myMessage.Subject = "Test Message";
myMessage.Body = "Hello world, from Chris' Mind";
myMessage.From = new MailAddress("[email protected]", "Chris");
myMessage.To.Add(new MailAddress("[email protected]", "John"));
SmtpClient mySmtpClient = new SmtpClient();
mySmtpClient.Send(myMessage);
}
}
Code:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
<system.web>
<pages theme="Monochrome">
<controls>
<add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx" />
</controls>
</pages>
<compilation debug="true" targetFramework="4.5.1">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5.1"/>
</system.web>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="Christopher <[email protected]>">
<network host="smtp.zanestate.edu" />
</smtp>
</mailSettings>
</system.net>
</configuration>
Is this something I will be able to do through this lesson??
Thanks in Advance,
Se7en