.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

email html form data in text file

Posted By: patrick     Posted Date: August 29, 2011    Points:5   Category :C#
on my current website it has a html contact form, it emails data to an email in plain text email format, however now it required in a text file attachment with comma delimited.

The page is actually in c#, I just use html to create basic contact form, can someone please give me ideas how I go about this??

Responses
Author: Narayanan             
Posted Date: August 30, 2011     Points: 20   

Hi,
try this
http://www.templatemonster.com/help/how-create-contact-form-html.html
http://www.freecontactform.com/email_form.php

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: patrick             
Posted Date: August 31, 2011     Points: 20   

thanks for the links, unfortunately I don't think it'll work on my server as it is running IIS and my pages are in C#.

It will be good if sometime similar available in C#

Author: Gowthammanju             
Posted Date: September 05, 2011     Points: 20   

Hi

First of all u retrieve the required data from sql table.

Then use:

System.Text.StringBuilder obj=new System.Text.StringBuilder();
obj.Append("<table><tr><td>");
obj.Append("Dear "+dr["Name"].ToString());
Please use the required fields in the above mentioned ways. Then initialise the obj in a string variable as shown below.
obj.Append("</td></tr></table>");
string body=obj.ToString();
Now U can send this body in mail. For sending mail, there r lots of link available. U can have a look on the following link also.


http://www.dotnetfunda.com/articles/article995-bulk-email-sending-through-gmail-.aspx

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: September 05, 2011     Points: 20   

To create file use FileStream class and use enumerator FileMode.OpenOrCreate or you can choose the enumerator.


try these coding as

FileStream fileStream = new FileStream(@"E:\file.txt", FileMode.OpenOrCreate);

StreamWriter streamWriter = new StreamWriter(fileStream);

streamWriter.BaseStream.Seek(0, SeekOrigin.End);
streamWriter.Write(" File Write Operation Starts : ");
streamWriter.Flush();
streamWriter.Close();


Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true
Author: Gowthammanju             
Posted Date: September 05, 2011     Points: 20   

Fro sending email using c# log in as


http://www.dreamincode.net/forums/topic/57355-sending-e-mail-messages-using-c%23/

Thanks & Regards,
GowthamManju
Chennai



Mark if the answer is true


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend