Click here to Skip to main content
15,892,809 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.net Control Pin
R. Giskard Reventlov19-Jul-12 5:39
R. Giskard Reventlov19-Jul-12 5:39 
GeneralRe: ASP.net Control Pin
safi belim19-Jul-12 7:06
safi belim19-Jul-12 7:06 
GeneralRe: ASP.net Control Pin
R. Giskard Reventlov19-Jul-12 7:22
R. Giskard Reventlov19-Jul-12 7:22 
QuestionWhat is ref and out and how to use in asp.net ? Pin
NeerajYadavMca2k518-Jul-12 21:23
NeerajYadavMca2k518-Jul-12 21:23 
AnswerRe: What is ref and out and how to use in asp.net ? Pin
Richard MacCutchan18-Jul-12 22:07
mveRichard MacCutchan18-Jul-12 22:07 
AnswerRe: What is ref and out and how to use in asp.net ? Pin
Sandeep Mewara18-Jul-12 22:39
mveSandeep Mewara18-Jul-12 22:39 
AnswerRe: What is ref and out and how to use in asp.net ? Pin
ashjassi17-Aug-12 2:55
ashjassi17-Aug-12 2:55 
QuestionSMPT server not sent an Email to gmail or yahoo mails Pin
Muhammad Fahim Baloch18-Jul-12 19:57
Muhammad Fahim Baloch18-Jul-12 19:57 
hi i have an error,
i have written a code to send an email.
the email was sent to private email address
like info@yourdomain.com

but the email was not sent to any
"gmail or yahoo mail address."

when i tried to sent an email to gmail or yahoo account the following error occurs,

"Bad sequence of commands. The server response was: This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server."

here is my code :

protected void SendEmail()
{

SmtpClient smtpClient = new SmtpClient("mail.mydomain.com", 25);
MailMessage Msg = new MailMessage();
//------for Email Data----------------------------------
Msg.To.Add(TxtEmail .Text .Trim ());
Msg.From = new MailAddress("tehnical@mydomain.com");

Msg.IsBodyHtml = true;

//----Get Max userid------------------------------
string strConnection = ConfigurationManager.ConnectionStrings["AIGamesConnectionString"].ConnectionString;
SqlConnection MaxUserIdCon = new SqlConnection(strConnection);
MaxUserIdCon.Open();
string StrMaxUserId = "select max(id) as Id from users";

SqlCommand MaxUserIdComm = new SqlCommand(StrMaxUserId, MaxUserIdCon);

SqlDataAdapter MaxUserIdDa = new SqlDataAdapter(MaxUserIdComm);

DataSet MaxUserIdDs = new DataSet();


MaxUserIdDa.Fill(MaxUserIdDs);
MaxUserIdCon.Close();

int MaxUserId=1;
if (MaxUserIdDs.Tables [0].Rows.Count >0)
{
MaxUserId = Convert.ToInt32(MaxUserIdDs.Tables [0].Rows [0]["Id"].ToString ());
}
//------------------------------------------------

StringBuilder bodyMsg = new StringBuilder();

bodyMsg.Append("Thank you for creating your account.\n\nPlease follow this link to activate: ");
bodyMsg.Append("

Activate Your Account");

Msg.Body = bodyMsg.ToString();

//authentication--------------------------------------------------------------------------------
SmtpClient mySmtpClient = new SmtpClient();
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential("tehnical@mydomain.com", "password");
mySmtpClient.Host = "mail.mydomain.com";
mySmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
mySmtpClient.UseDefaultCredentials = false;
mySmtpClient.Credentials = myCredential;

//-------------------------------------------------------------------------------------------
mySmtpClient.Send(Msg);
LblMessage.Text = "An email for account verification has been sent,please check your email";
EmptyTextBoxes();

// ------for Email Data----------------------------------
}
AnswerRe: SMPT server not sent an Email to gmail or yahoo mails Pin
Rajesh Buddaraju19-Jul-12 6:15
Rajesh Buddaraju19-Jul-12 6:15 
AnswerRe: SMPT server not sent an Email to gmail or yahoo mails Pin
jkirkerx19-Jul-12 8:19
professionaljkirkerx19-Jul-12 8:19 
AnswerRe: SMPT server not sent an Email to gmail or yahoo mails Pin
phani.sv21-Jul-12 0:37
phani.sv21-Jul-12 0:37 
Questionretain scrollbar position Pin
dcof18-Jul-12 8:47
dcof18-Jul-12 8:47 
AnswerRe: retain scrollbar position Pin
Sandeep Mewara18-Jul-12 9:26
mveSandeep Mewara18-Jul-12 9:26 
GeneralRe: retain scrollbar position Pin
dcof18-Jul-12 11:39
dcof18-Jul-12 11:39 
GeneralRe: retain scrollbar position Pin
Trak4Net18-Jul-12 12:35
Trak4Net18-Jul-12 12:35 
GeneralRephrase the Question Pin
jkirkerx18-Jul-12 13:01
professionaljkirkerx18-Jul-12 13:01 
GeneralRe: Rephrase the Question Pin
Trak4Net18-Jul-12 14:40
Trak4Net18-Jul-12 14:40 
GeneralRe: Rephrase the Question Pin
jkirkerx18-Jul-12 16:01
professionaljkirkerx18-Jul-12 16:01 
GeneralRe: Rephrase the Question Pin
dcof18-Jul-12 18:49
dcof18-Jul-12 18:49 
GeneralRe: Rephrase the Question Pin
Trak4Net18-Jul-12 19:29
Trak4Net18-Jul-12 19:29 
GeneralRe: Rephrase the Question Pin
jkirkerx18-Jul-12 19:35
professionaljkirkerx18-Jul-12 19:35 
GeneralRe: Rephrase the Question Pin
Trak4Net18-Jul-12 19:38
Trak4Net18-Jul-12 19:38 
GeneralRe: Rephrase the Question Pin
jkirkerx18-Jul-12 19:42
professionaljkirkerx18-Jul-12 19:42 
GeneralRe: Rephrase the Question Pin
jkirkerx18-Jul-12 19:32
professionaljkirkerx18-Jul-12 19:32 
AnswerRe: retain scrollbar position Pin
Sandeep Mewara18-Jul-12 19:37
mveSandeep Mewara18-Jul-12 19:37 

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.