|
I think the problem is the fact you are trying to use mail.hotmail.com try adding your Credentials to the sending, if not find a different SMTP Server
<br />
public Send Mail()<br />
{<br />
MailMessage message = new MailMessage("Send to Addr", "From Address", "Subject", "Message");<br />
message.IsBodyHtml = true;<br />
SmtpClient emailClient = new SmtpClient("Othe SMTP");<br />
emailClient.UseDefaultCredentials = false;<br />
System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential("YourSmtpUserName something@yourhost.com", "emailpassword");<br />
emailClient.Credentials = basicAuthenticationInfo;<br />
emailClient.Send(message);<br />
}<br />
|
|
|
|
|
Hy,thankz for replyng to my message....I had used aonther code ...
protected void btnSend_Click(object sender, EventArgs e)
{
Response.Write("hy");
MailMessage msg = new MailMessage();
msg.To = txtTo.Text;
msg.From = txtFrom.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Value;
lblStatus.Text = "Sending...";
SmtpMail.SmtpServer = "smtp.gmail.com";
SmtpMail.Send(msg);
lblStatus.Text = "Sent email (" + txtSubject.Text + ") to " + txtTo.Text;
}
}
i get an error dat i sould issue an STARTTLS command first...can u recommend de changes dat i should make...
should i make any changes in de VIRTYAL SMTP SERVER and create a neew connection..
regards
|
|
|
|
|
Hi,
here is my code, which is same as your one. but not working as System.Net.Mail classes doesn't support SMTPS.
SmtpClient client = new SmtpClient("smtp.gmail.com", 465);
MailMessage mail_msg = new MailMessage();
MailAddress fromAdd = new MailAddress(tbFrom.Text.Trim());
mail_msg.From = fromAdd;
mail_msg.To.Add(new MailAddress(tbTo.Text.Trim()));
mail_msg.Subject = tbSubject.Text;
mail_msg.IsBodyHtml = true;
mail_msg.Body = "Message From: " + tbFrom.Text.Trim() + "Subject:" + tbSubject.Text.Trim() + "Email: " + tbTo.Text.Trim() + "Content: " + tbContent.Text.Trim();
System.Net.NetworkCredential basicCredential = new System.Net.NetworkCredential(tbFrom.Text, "my password");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = basicCredential;
client.Send(mail_msg);
Himanshu Manjarawala.
Sr. Software engineer @AutomationAnywhere
http://www.himanshumbi.blogspot.com
http://www.fieredotnet.wordpress.com
|
|
|
|
|
What .net Framework you using also add your account details to the smtpClient the code I gave you last answer works everytime.
|
|
|
|
|
Hi I am building a access restriction system into my logon and it work great for IPv4 only allow access to pcs with the following IP's 172.74.20.x but how does this work with IPv6? fe80::91da:172b:26fe:994d%10 ????
Thanks
|
|
|
|
|
I have two text box. one is for name and another for Address.
In name text box i want insert not more than 15 characters(alphabet). and in address I want insert 55 characters.
I use in name textbox:
D[a-zA-Z]*
It prints name in alphabet but it takes more than 15 characters.
Please guide me.
thanx
|
|
|
|
|
You should buy a book on regular expressions, or do some reading. There's a windows program called Expresso that will also help. You can enter as many chars as you like b/c that is exactly what the * means.
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
|
Thanks.
but this query is not accept white space character
|
|
|
|
|
|
Hi all,
How to get the Gridview data (after binding the gridview) into DataTable ?
I tried in the following way. But its giving Exception Unable Convert 'System.Web.UI.WebControls.GridViewRowCollection' to 'System.Data.DataRow'
DataTable dt= new DataTable();
foreach(DataRow drow in Gridview1.Rows)
{
dt.Rows.Add(drow);
}
Please suggest me how to do that.
Thanks in advance.
modified on Wednesday, October 29, 2008 2:32 AM
|
|
|
|
|
Try this:
foreach(GridViewRow drow in GridView1.Rows)
{
dt.Rows.Add(drow);
}
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Thanks for your suggestion.
I will try that.
|
|
|
|
|
Hello Meeram395,
I tried. But i got exception
System.ArgumentException: Input array is longer than the number of columns in this table.
foreach(GridViewRow drow in GridView1.Rows)
{
dt.Rows.Add(drow); //Here i got the above exception
}
|
|
|
|
|
Hello meeram395,
I solved the that exception.
But I am getting empty datarows. DataItem : null
My logic:
BindGridview();
DataTable dt = new DataTable();
dt.Columns.Add();
foreach (GridViewRow dr in GvReport.Rows)
{
dt.Rows.Add(dr); // I am getting the row count as 10. But DataItem is null
}
|
|
|
|
|
I have tried as below and getting the results successfully:
DataTable dt = new DataTable();
dt.Columns.Add();
dt.Columns[0].ColumnName = "User Name";
dt.Columns.Add();
dt.Columns[1].ColumnName = "User Email";
foreach (GridViewRow row in SearchGrid.Rows)
{
DataRow dr = dt.NewRow();
dr["User Name"] = row.Cells[1].Text;
dr["User Email"] = row.Cells[2].Text;
dt.Rows.Add(dr);
}
Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Try this
DataTable workTable= new DataTable();
DataRow workRow = workTable.NewRow();
foreach(DataRow workRow in Gridview1.Rows)
{
workRow["Fields"] = //your gridview rows
dt.Rows.Add(workRow);
}
|
|
|
|
|
Good Afternoon
My Service Killer was designed to kill certain Services and the main Service was "w3wp.exe" , Before the Implementation of the Serice my users Started to loose sessions , there was some settings that have been adjusted in the Recycling on the IIS, and now the "w3wp.exe" gets killed every 10 min, and am not sure if this has to do with the Sessions that are lost.
Need advice
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You are a retard. You write an app that kills a process that is part of IIS, then you're surprised that people lose their sessions ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Thanks for your Comment.
Noted.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Well said!
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".
|
|
|
|
|
Hi, when i am exporting gridview data to excel file, i am facing following error.. can any one give idea..why it so like this?
"Control 'GVExcel' of type 'GridView' must be placed inside a form tag with runat=server."
My code is as follows
mypage.aspx
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GVExcel" runat="server">
</asp:GridView>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
Mypage.aspx.cs
string connstr = "Data Source=ORG33;Initial Catalog=MYDatabase;User ID=sa;Password=miller";
SqlConnection sqlcon = new SqlConnection(connstr);
sqlcon.Open();
string cmdcnt = "Select top 10 * from ORG_TBL_INDSEEDFirst";
SqlDataAdapter sqlda = new SqlDataAdapter(cmdcnt, sqlcon);
sqlda.Fill(ds);
dt = ds.Tables[0];
GVExcel.DataSource = dt;
GVExcel.DataBind();
StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GVExcel.RenderControl(htmlWrite); ---Getting Error here
sqlcon.Close();
G. Satish
|
|
|
|
|
Hi All,
I am unsing a HtmlImage in my code and on the click of this image I want to call the key combination "Cltr + Alt + 6". How can I call this key combination using java script.
Plz help me.
Thanks In Advance
Alok...
|
|
|
|
|
I'm facing a problem in blob object in crystal report. What i need is to export a crystal report to PDF format having a blob object(ASP.net Code)
This is the code i'm using.
Dim mstExport As New System.IO.MemoryStream
Response.ClearContent()
Response.ClearHeaders()
If Me.optExcel.Checked Then
mstExport = crReport.ExportToStream(ExportFormatType.WordForWindows)
Response.ContentType = "application/vnd.ms-word"
Else
mstExport = crReport.ExportToStream(ExportFormatType.PortableDocFormat)
Response.ContentType = "Application/pdf"
End If
crReport.Close()
Response.Buffer = "true"
Response.BinaryWrite(mstExport.ToArray())
Response.End()
But when i export this i get an error saying "error detected by dll"
If that image is not there it works fine
(i'm creating an xml schema for data retrieval)
Pls help me. Its very urgent
modified on Wednesday, October 29, 2008 3:47 AM
|
|
|
|
|
Does anybody know the links for top asp.net ebooks download?
|
|
|
|