here's the code:
<%@dotnet.itags.org. Page Language="C#" %>
<script runat="server"
void Button1_Click(object sender, EventArgs e) {// Build a MailMessage
System.Web.Mail.MailMessage mailMessage = new System.Web.Mail.MailMessage();
mailMessage.From = "guito_d@dotnet.itags.org.hotmail.com";
mailMessage.To = "guitod@dotnet.itags.org.gis.net";
mailMessage.Subject = "Email Subject";
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
mailMessage.Body = TextBox1.Text;
System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send(mailMessage);
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:TextBox id="TextBox1" runat="server" Columns="40" TextMode="MultiLine" Rows="5"></asp:TextBox>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>
</p>
</form>
</body>
</html>
where it says smtpserver should i put this number 127.0.0.1 in the code;? Do I have to configure my smtp server here locally? and if I do what steps do I have to take? thankyou (still tring to grab the concept)
lmmmmm
Joined: 10 Feb 2003
Total Posts: 58
Re: sending an electronic form to my email box
Posted: 01-24-2005 02:09 PM
first you have to verify you have smtp running on IIS
frankkk
Joined: 25 Aug 2004
Total Posts: 41
Re: sending an electronic form to my email box
Posted: 01-25-2005 09:39 AM
thanks immmmmmmmmm; looks like it's running; I right clicked the smtp virtual server; and the start option was activated; do you know what step I take next Immmmmmm; thankyou sir :O)
Ok does anyone know what my next step is? thankyou for your time :O)
Edit by moderator - NetProfit: Please place your code blocks between <code></code> tags! :)Yes, you have to have a configured smtp server running to send mail. If you are using localhost or 127.0.0.1 (same thing) you need to configure IIS on your machine to run SMTP.
thanks for responding Chuck; ok do you know what steps I take to configure IIS; thankyou
google..."smtp windows 2003"
http://www.winnetmag.com/Article/ArticleID/40810/40810.html
configuring it in xp is virtually the same....
here is another link
http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/POP3_howTo_SMTP_relay.asp
K I'll try it thanks chuck :O)
0 comments:
Post a Comment