ASP.NET
|
|
 |
|

|
so u say english[UK] and english[US] are same from translation perspective ....similarly french[france] and french[canada] are same?thanks for ur immediate response...
|
|
|
|

|
<system.net>
<mailSettings>
<smtp from="development@relone.com">
<network host="mail.relone.com" port="16" userName="development@relone.com" password="password" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net>
this is my web.config setting.actually system has to send mail on button click event."from mail id" is development@relone.com .i vil get "to mail id" from db.what statement do i have to write on code behind to get this default address.pls help me
|
|
|
|

|
Try something like:
public static void CreateTestMessage(string emailIdFromDatabase)
{
MailAddress to = new MailAddress("development@relone.com");
MailAddress from = new MailAddress(emailIdFromDatabase);
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the new SMTP client.";
message.Body = @"Using this new feature, you can send an e-mail message from an application very easily.";
SmtpClient client = new SmtpClient();
Console.WriteLine("Sending an e-mail message to {0} at {1} by using the SMTP host={2}.",
to.User, to.Host, client.Host);
try {
client.Send(message);
}
catch (Exception ex) {
Console.WriteLine("Exception caught in CreateTestMessage(): {0}",
ex.ToString() );
}
}
For a Web application, the parameterless constructor of SmtpClient reads its configuration from the web.config configuration file.
Refer: MSDN: SmtpClient Constructor[^]
For more details on sending email, have a look at this Microsoft Video tutorial:
Video: Use ASP.NET to send Email from Website[^]
Tutorials on sending Email in ASP.NET[^]
|
|
|
|

|
SmtpServer.Host = SMTPHost;
SmtpServer.Port = SMTPPort;
SmtpServer.Credentials = new NetworkCredential(CredentialEmailId, CredentialPassword);
SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
could u tell me why the above lines of code is used;what should i write fr smtphost,smtpPort,credentialemailid & credentialpassword.
from now onwards i won't repost.
Console.WriteLine("Sending an e-mail message to {0} at {1} by using the SMTP host={2}.",
to.User, to.Host, client.Host);
i am unable to understand the above statement.pls don't mind i am new to asp.net.
thanks
|
|
|
|

|
Member 8701813 wrote: SmtpServer.Port = SMTPPort;
SmtpServer.Credentials = new NetworkCredential(CredentialEmailId, CredentialPassword);
SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
Not sure where from you picked it as I did not suggested so in my snippet. Moving on, having these lines is not an issue - only difference is, this is runtime defining the parameters needed, which otherwise could be picked from web.config file. Defining them at any one place is good enough. Keep config entry you shared in original question OR keep current above lines with values as was filled in config.
Member 8701813 wrote: i am unable to understand the above statement
You can ignore/comment them. It was kind of logging to see what happened, not necessary for sending email.
|
|
|
|
|

|
these are my mai settings.when i click on button i have to get this address.this is from mail id.i vil get "to mail id from db.getting mail id from db is not a pbm.my pbm is how to get this development@relone.com .actually system has to send mail on button click event
pls help me
|
|
|
|
|

|
Hi,
I am having gridview and in that edit and view map buttons are present. i am using model popup for dispalying the data when user clicks on edit, like wise if i user clicks on view map i need to load the google maps with related markers.i am using updatepanel to stop the page refresh.
Now i am facing the issue while loading the google maps.at first time when page loads the map is loading properly when i click on the view map next time the map loads at the corner of the modelpopup ... can u me the solution for this.. why it is loading like this... i am researching this from so many days....
please give me reply as soon as possible whether the update panel is stooping the refreshing of google maps...
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin