[thelist] Still having .net email contact page problem

Tom Dell'Aringa pixelmech at yahoo.com
Mon Mar 7 10:13:46 CST 2005


Sorry for reposting this but I am still stuck :( Shouldn't be this hard I'm thinking. Again, I
have a simple form with two fields. I want to process those two fields and include that text in
the body of an e-mail and send it off. 

Currently my form submits to the processing page below. The two lines 

string myName = name.Text;
string myComments = comments.Text;

follow the convention inputID.Text of the form. I've tried Dim'ing them too. Either way it errors
out so I am doing this wrong somehow, i either get that I need a semi-colon (which is there) or
the namespace type cannot be found. 

here is the processing page:
---------------
<% @Page Language="C#" Debug="true" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();

msgMail.To = "tom.dellaringa at .com";
msgMail.From = "no-reply at .com";
msgMail.Subject = "eHandbook Feedback";

string myName = name.Text;
string myComments = comments.Text;

msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><h2>eHandbook Feedback</h2>" +
   "<p>Comments:</p><p>" + myComments + "</p></body></html>";
msgMail.Body = strBody;

SmtpMail.Send(msgMail);

Response.Write("Email was queued to disk");
%>
-------------

If I remove those two lines it works fine, so I just need to correctly get my form data into a
varaible - should be a simple thing I know, but can't seem to figure it out. 

Thanks

Tom


http://www.pixelmech.com/

Melissa: Ace, Where are you?
Ace Ventura: I'm in Psychoville and Finkle's the Mayor.



More information about the thelist mailing list