Email sending problem from Godaddy server solved in ASP.NET (108 situations)

2 Comments


Hello  everybody. When I am trying to send an email with HTML format the values are coming from database i felt problem with godaddy server.

నేను ఒకసారి GoDaddy ద్వారా ఈమెయిలు పంపిస్తుంటే చాలా ప్రొబ్లెంస్ వచ్చాయి
నేను వాటిని పరిశోధించి చివరికి చిన్న సమాధానం కనుకునా ఏమైనా సందేహం వుంటే మెయిల్ చెయ్యండి

Email; radhek@gmail.com

To solve that we must add relay hosting.

I’d just like to add that when you’re sending email via “relay-hosting.secureserver.net” you will be able to send email via the GoDaddy server but it will not work if you run it locally. This is normal – it’s a security feature.

Code below

using system.net.mail namespace.

const string SERVER = “relay-hosting.secureserver.net”;

System.Net.Mail.MailMessage objMail = new System.Net.Mail.MailMessage();

objMail.From = new MailAddress(“”);objMail.To.Add(MailId);

objMail.Bcc.Add(BCC);

objMail.IsBodyHtml = true;

objMail.Subject = “Order Confirmation”;

objMail.Priority = System.Net.Mail.MailPriority.High;

objMail.Body = “<h1>hi</h1>”;

SmtpClient Client = new SmtpClient(SERVER);Client.Send(objMail);

U need to Specifie the SMTP CLIENT SERVER LIKE THAT

This is working with my Godaddy Server try out

Advertisements

Gmail down

Leave a comment


Hi friends My gmail account is not opening from yesterday night i.e 6th Aug 08 and also not opening today.

ఫైరుఫాక్సు లో జిమెయిల్ రావటం లేదు కాని అదే ఇంటర్నెట్ ఎక్సప్లోరర్ లో వస్తుంది

I dont know what happened exactly so I have send a mail to gmail team they send the following reply:

Hello,

Thank you for your report.

We are aware of this problem, and our engineers are making progress to
restore account access. You can find timely updates in the Gmail Help
Discussion group at:
http://groups.google.com/group/Gmail-Help-Announcements-and-Alerts-en/browse_thread/thread/f92b062153654584.
We apologize for any inconvenience this has caused.

Sincerely,

The Google Team

I dont know what happened this is drawback of google.

I have read many blogs and I found that same account is opening in IE.

I tried opening in IE it is working fine.

I dont know what happened with IE only its working.

I must switch to some other alternative to gmail.

How to know the width & height of an uploaded image in ASP.NET

Leave a comment


How to know the width & height of an uploaded image in ASP.NET

ఇమేజ్ యొక్క పొడవు వెడల్పు in ASP.NET

Import the namespace using System.IO;
Step 1:
using System.IO;

Step 2:
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(Image1.PostedFile.InputStream);
Here Image1 is the name of uploaded image.

System.Drawing.Image.FromStream
Creates an Image from the specified data stream.
To know more visit: http://msdn.microsoft.com/en-us/library/system.drawing.image.fromstream.aspx

Step 3:
Now you can get width and height of image using

UploadedImage.Width
UploadedImage.Height

Random number generation in ASP.NET

1 Comment


Random number generation in ASP.NET

ఏదో ఒక్క నెంబర్ జనరేషన్ in ASP.NET

Step 1:

write a class file.
eg:

Create a cs file named as rand.cs

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 Microsoft.VisualBasic;

/// <summary>
/// Summary description for random_number
/// </summary>
public class random_number
{
public string GetRandomNumber(int length, string characterSet)
{

string randomData = “”;

int position = 0;

byte[] data = new byte[length];

int characterSetLength = characterSet.Length;

System.Security.Cryptography.RandomNumberGenerator random = System.Security.Cryptography.RandomNumberGenerator.Create();

random.GetBytes(data);

for (int index = 0; (index < length); index++)
{

position = data[index];

position = (position % characterSetLength);

randomData = (randomData + characterSet.Substring(position, 1));

}

return randomData;

}

}

step 2:

use this in codebehind of any aspx page

random_number r1 = new random_number();
string str= r1.GetRandomNumber(5, “ABCDEFGHIJLLMNOPQRSTUVWXYZ_1234567890”);

ASP.NET Tutorials

Leave a comment


ASP.NET లో బేసిక్స్ కావాలంటే చూడండి

http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx

చాలా బాగా అర్ధమయ్యిది.

Gridview operations Edit,Delete,Update

2 Comments


గ్రిడ్ వ్యూ లో కొన్ని  ఆపరేషన్లు

BoundField in Grid view and bind the data to each field using “Edit Column” option in smarttag of grid view.

We can also add images to Edit and Delete option in Grid view “edit columns” by adding a “commandfield”.

String con1 = ConfigurationManager.ConnectionStrings[“con”].ToString();

DataSet ds = new DataSet();

protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)

{

GridView1.EditIndex = -1;

bindata();

}

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)

{

string i = GridView1.DataKeys[e.RowIndex].Value.ToString();

int j = Convert.ToInt32(i);

TextBox t1 = new TextBox();

t1 = (TextBox)GridView1.Rows[e.RowIndex].Cells [0].Controls [0];

TextBox t2 = new TextBox();

t2 = (TextBox)GridView1.Rows[e.RowIndex].Cells [1].Controls [0];

TextBox t3 = new TextBox();

t3 = (TextBox)GridView1.Rows[e.RowIndex].Cells [2].Controls [0];

SqlConnection con = new SqlConnection(con1);

string upt = “update Allergies set Allergy = @allergy, Symptoms = @symptom, Action_to_be_taken =@action where Allergy_id=” + j;

SqlCommand cmd = new SqlCommand(upt, con);

cmd.Parameters.Add(“@allergy”, SqlDbType.VarChar).Value = t1.Text;

cmd.Parameters.Add(“@symptom”, SqlDbType.VarChar).Value = t2.Text;

cmd.Parameters.Add(“@action”, SqlDbType.VarChar).Value = t3.Text;

con.Open();

cmd.ExecuteNonQuery();

con.Close();

GridView1.EditIndex = -1;

bindata();

}

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)

{

GridView1.EditIndex = e.NewEditIndex;

bindata();

}

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)

{

string i = GridView1.DataKeys[e.RowIndex].Value.ToString();

int j = Convert.ToInt32(i);

SqlConnection con = new SqlConnection(con1);

string del = “Delete from Allergies where Allergy_id=” + j;

SqlCommand cmd = new SqlCommand(del, con);

con.Open();

cmd.ExecuteNonQuery();

con.Close();

GridView1.EditIndex = -1;

bindata();

}

Automatically refresh a page after a popup window has been closed in ASP.NET

Leave a comment


ఫొప్ అప్ బాక్స్ ముసివెసినా తర్వతా పరెంట్ పెజ్ రిఫ్రెష్ అవుతుంది

in popup.aspx write down the following line

Response.Write(“<script>window.opener.location=’sample.aspx’;window.close();</script>”)

this will close popup after clicking save button of popup and refresh the parent form.

భరత్ రాధే కృష్ణ

Older Entries

%d bloggers like this: