Click here to Skip to main content
15,893,814 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: automatic email generation Pin
sashidhar15-Dec-09 0:08
sashidhar15-Dec-09 0:08 
GeneralRe: automatic email generation Pin
Abhijit Jana15-Dec-09 1:51
professionalAbhijit Jana15-Dec-09 1:51 
GeneralRe: automatic email generation Pin
sashidhar15-Dec-09 3:06
sashidhar15-Dec-09 3:06 
GeneralRe: automatic email generation Pin
Abhijit Jana15-Dec-09 20:24
professionalAbhijit Jana15-Dec-09 20:24 
GeneralRe: automatic email generation Pin
sashidhar15-Dec-09 20:34
sashidhar15-Dec-09 20:34 
GeneralRe: automatic email generation Pin
Ashfield15-Dec-09 4:24
Ashfield15-Dec-09 4:24 
GeneralRe: automatic email generation Pin
sashidhar15-Dec-09 4:48
sashidhar15-Dec-09 4:48 
QuestionSending Mail over Intranet Pin
.NET- India 14-Dec-09 20:01
.NET- India 14-Dec-09 20:01 
Hello Friends,

I'm sending mail using the following code and mail is working fine.


SmtpClient client = new SmtpClient();
string from = "manoj.msb1984@gmail.com";
MailAddress From = new MailAddress(from);

//To whom the mail is being sent
string to = "depth.heart@gmail.com";
MailAddress To = new MailAddress(to);

//To whom Carbon copy is being sent if there is not don't write this code
//string cc = "rawgirish@gmail.com";
//MailAddress Cc = new MailAddress(cc);

//Creat an object for MailMessage
MailMessage message = new MailMessage(From, To);

//Set Message body HTML true otherwise sometime it send html code
message.IsBodyHtml = true;

//Add Your Subject
message.Subject = "Add You Subject Here";

//Add Body of the Mail here
string strBody = "Hello, This is Manoj Bisht <br> Got It";
message.Body = strBody;

try
{
//Send the Mail
client.Send(message);

//Show sent message if mail is sent successfully
Response.Write("Mail Sent Successfully");
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}



But when im using this code to send email over intranet it's throwing error as shown below

{"Failure sending mail."}
[System.Net.Mail.SmtpException]: {"Failure sending mail."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {"Unable to connect to the remote server"}
Message: "Failure sending mail."
Source: "System"
StackTrace: " at System.Net.Mail.SmtpClient.Send(MailMessage message)\r\n at Rough_New.cmdSend_Click(Object sender, EventArgs e)"
TargetSite: {Void Send(System.Net.Mail.MailMessage)}

AnswerRe: Sending Mail over Intranet Pin
Abhijit Jana14-Dec-09 20:28
professionalAbhijit Jana14-Dec-09 20:28 
GeneralRe: Sending Mail over Intranet Pin
.NET- India 14-Dec-09 20:32
.NET- India 14-Dec-09 20:32 
GeneralRe: Sending Mail over Intranet Pin
Abhijit Jana14-Dec-09 21:30
professionalAbhijit Jana14-Dec-09 21:30 
QuestionMultiple Columns in Dropdown list [modified] Pin
SreejithKumar M14-Dec-09 16:55
SreejithKumar M14-Dec-09 16:55 
AnswerRe: Multiple Columns in Dropdown list Pin
Abhijit Jana14-Dec-09 17:08
professionalAbhijit Jana14-Dec-09 17:08 
QuestionSetting Background Pin
eivah14-Dec-09 15:25
eivah14-Dec-09 15:25 
AnswerRe: Setting Background Pin
Xmen Real 14-Dec-09 16:20
professional Xmen Real 14-Dec-09 16:20 
AnswerRe: Setting Background Pin
Abhijit Jana14-Dec-09 16:53
professionalAbhijit Jana14-Dec-09 16:53 
GeneralRe: Setting Background Pin
eivah20-Dec-09 14:44
eivah20-Dec-09 14:44 
QuestionApplication state Vs Multiple users Pin
sandeepranjan14-Dec-09 13:39
sandeepranjan14-Dec-09 13:39 
AnswerRe: Application state Vs Multiple users Pin
Not Active14-Dec-09 15:23
mentorNot Active14-Dec-09 15:23 
AnswerRe: Application state Vs Multiple users Pin
Abhijit Jana14-Dec-09 17:05
professionalAbhijit Jana14-Dec-09 17:05 
QuestionTool for seeing the content of HTTP and SMTP messages Pin
FJJCENTU14-Dec-09 11:57
FJJCENTU14-Dec-09 11:57 
QuestionKnow of a control or way to view multi-page tiffs? Pin
Corey Blair14-Dec-09 10:56
Corey Blair14-Dec-09 10:56 
QuestionRemote server returned error. notfound. help! [modified] Pin
leone14-Dec-09 8:43
leone14-Dec-09 8:43 
AnswerRe: Remote server returned error. notfound. help! Pin
OriginalGriff14-Dec-09 9:12
mveOriginalGriff14-Dec-09 9:12 
QuestionHow can you access the Application Attributes via API? Pin
msell015014-Dec-09 6:13
msell015014-Dec-09 6:13 

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.