Click here to Skip to main content
15,905,614 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questioniframe pop working in IE but not in FireFox Pin
kamran pervaiz12-Feb-10 1:47
kamran pervaiz12-Feb-10 1:47 
AnswerRe: iframe pop working in IE but not in FireFox Pin
T M Gray12-Feb-10 5:14
T M Gray12-Feb-10 5:14 
QuestionClickheat Clickmap? Pin
emiliovillarox12-Feb-10 0:18
emiliovillarox12-Feb-10 0:18 
QuestionIIS problem in asp.net Pin
JC.KaNNaN12-Feb-10 0:00
JC.KaNNaN12-Feb-10 0:00 
AnswerRe: IIS problem in asp.net Pin
Abhijit Jana12-Feb-10 1:54
professionalAbhijit Jana12-Feb-10 1:54 
QuestionSQL SErver REplication Pin
satsumatable11-Feb-10 23:15
satsumatable11-Feb-10 23:15 
AnswerRe: SQL SErver REplication Pin
Eddy Vluggen12-Feb-10 2:00
professionalEddy Vluggen12-Feb-10 2:00 
Questionsending mail through smtp Pin
amitamit09911-Feb-10 22:48
amitamit09911-Feb-10 22:48 
i am sending mail through smtp.it is working fine but problem is that when i refresh the page mail again be send.i don't want to send mail again when page will refresh.plz help me.............

this is my code

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Net.Mail;
using System.Text;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "Contact US";
txt_name.Focus();
lbl_status.Visible = false;
}
protected void btn_submit_Click(object sender, EventArgs e)
{

MailMessage mailMsg = new MailMessage("xyz@xyx.in","abc@abc.in");

string name = txt_name.Text.Trim();
string address = txt_add.Text.Trim();

string telnor = txt_telcr.Text.Trim() + "-" + txt_telnr.Text.Trim();
string telnoo = txt_telco.Text.Trim() + "-" + txt_telno.Text.Trim();
string faxno = txt_faxn.Text.Trim();
string mobileno = txt_mobile.Text.Trim();
string typeofwork = rdo_type.Text.Trim();
string query = list_query.Text.Trim();
string Email = Emailid.Text.Trim();
if (Email == "") { Email = "dummyforcheck@in.com"; }
mailMsg.Subject = name + " wants to contact us";
mailMsg.IsBodyHtml = true;
MailMessage mailMsgUser = new MailMessage("xyx@xyz.in", Email);
mailMsgUser.Subject =" Yoyr mail has been recived";
mailMsgUser.IsBodyHtml = true;

mailMsg.Body = "<b> Name :" + name + "<br/><b>Address :"
+ address + "<br/><b>Phone Number(R) :" + telnor + "<br/><b>Phone Number(O) :" + telnoo +
"<br/><b>Fax Number :" + faxno + "<br/><b>Mobile Number :" + mobileno + "<br/><b>Mobile Number :"
+ Email + "<br/><b>Type Of Work :" + typeofwork + "<br/><b>Query :" + query;

mailMsgUser.Body = "<b> Esteemed <br/><b> Dear </b>" + name + "<br/><br/><span style='margin-left:50px'> Thanks for contacting us. Our sales executive will contact you shoon.</span><br/><br/><br/><b>Thank you<br/>Royal Village Team.";


mailMsg.Priority = MailPriority.High;
mailMsgUser.Priority = MailPriority.High;

SmtpClient smtpclnt = new SmtpClient();
NetworkCredential nc = new NetworkCredential("xyx@xyz.in", "xyz");
smtpclnt.Host = "smtp.xyz.in";
smtpclnt.UseDefaultCredentials = false;
smtpclnt.Credentials = nc;
smtpclnt.EnableSsl = false;
try
{
smtpclnt.Send(mailMsg);
smtpclnt.Send(mailMsgUser);
lbl_status.Visible = true;
lbl_status.Text = "Thanks for contacting us.Our sales executive will contact you soon";
clearall();

}
catch(Exception ex)

{
lbl_status.Visible = true;
lbl_status.Text = "Oops! there may be problem in internet connection";
}


}
protected void btn_reset_Click(object sender, EventArgs e)
{
clearall();
}
protected void clearall()
{
txt_name.Text = "";
txt_add.Text = "";
txt_telcr.Text = "";
txt_telnr.Text = "";
txt_telco.Text = "";
txt_telno.Text = "";

txt_faxn.Text = "";
txt_mobile.Text = "";
rdo_type.Text = "";
list_query.Text = "";
Emailid.Text = "";

}
}
AnswerRe: sending mail through smtp Pin
R22k11-Feb-10 23:29
R22k11-Feb-10 23:29 
GeneralRe: sending mail through smtp Pin
amitamit09912-Feb-10 1:17
amitamit09912-Feb-10 1:17 
AnswerRe: sending mail through smtp Pin
T M Gray12-Feb-10 5:05
T M Gray12-Feb-10 5:05 
GeneralRe: sending mail through smtp Pin
PunkIsNotDead12-Feb-10 6:03
PunkIsNotDead12-Feb-10 6:03 
GeneralRe: sending mail through smtp Pin
T M Gray12-Feb-10 6:14
T M Gray12-Feb-10 6:14 
QuestionHow Template style change Pin
Ajeet kumar verma11-Feb-10 22:45
Ajeet kumar verma11-Feb-10 22:45 
AnswerRe: How Template style change Pin
Anurag Gandhi12-Feb-10 0:29
professionalAnurag Gandhi12-Feb-10 0:29 
AnswerRe: How Template style change Pin
T M Gray12-Feb-10 5:58
T M Gray12-Feb-10 5:58 
QuestionTextbox Scroll Bar Pin
koncuk11-Feb-10 22:32
koncuk11-Feb-10 22:32 
AnswerRe: Textbox Scroll Bar Pin
s.mn11-Feb-10 23:35
s.mn11-Feb-10 23:35 
GeneralRe: Textbox Scroll Bar Pin
koncuk12-Feb-10 0:37
koncuk12-Feb-10 0:37 
GeneralRe: Textbox Scroll Bar Pin
s.mn12-Feb-10 0:41
s.mn12-Feb-10 0:41 
GeneralRe: Textbox Scroll Bar Pin
koncuk12-Feb-10 0:57
koncuk12-Feb-10 0:57 
AnswerRe: Textbox Scroll Bar Pin
T M Gray12-Feb-10 7:57
T M Gray12-Feb-10 7:57 
GeneralRe: Textbox Scroll Bar Pin
koncuk14-Feb-10 20:58
koncuk14-Feb-10 20:58 
QuestionNot able To show loading image Pin
Any_India11-Feb-10 21:47
Any_India11-Feb-10 21:47 
AnswerRe: Not able To show loading image Pin
T M Gray12-Feb-10 6:12
T M Gray12-Feb-10 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.