Click here to Skip to main content
15,903,775 members
Home / Discussions / C#
   

C#

 
AnswerRe: DateTime convert ? Pin
Mazdak16-Jan-04 4:06
Mazdak16-Jan-04 4:06 
Generalwindows services\serial port Pin
tim_mid16-Jan-04 1:06
tim_mid16-Jan-04 1:06 
GeneralRe: windows services\serial port Pin
Uwe Keim16-Jan-04 4:40
sitebuilderUwe Keim16-Jan-04 4:40 
GeneralThe path is not a legal form Pin
Simon Wren16-Jan-04 0:55
professionalSimon Wren16-Jan-04 0:55 
GeneralRe: The path is not a legal form Pin
Heath Stewart16-Jan-04 5:19
protectorHeath Stewart16-Jan-04 5:19 
QuestionWhen is my window hidden? Pin
Rhodri Jenkins15-Jan-04 23:02
Rhodri Jenkins15-Jan-04 23:02 
AnswerRe: When is my window hidden? Pin
occcy16-Jan-04 0:51
occcy16-Jan-04 0:51 
GeneralRe: When is my window hidden? Pin
Jeremy Kimball16-Jan-04 6:52
Jeremy Kimball16-Jan-04 6:52 
GeneralSmtpMail question Pin
Mazdak15-Jan-04 21:59
Mazdak15-Jan-04 21:59 
GeneralRe: SmtpMail question Pin
Heath Stewart16-Jan-04 4:38
protectorHeath Stewart16-Jan-04 4:38 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 4:48
Mazdak16-Jan-04 4:48 
GeneralRe: SmtpMail question Pin
Heath Stewart16-Jan-04 4:52
protectorHeath Stewart16-Jan-04 4:52 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 5:13
Mazdak16-Jan-04 5:13 
GeneralRe: SmtpMail question Pin
Rocky Moore16-Jan-04 8:35
Rocky Moore16-Jan-04 8:35 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 8:39
Mazdak16-Jan-04 8:39 
GeneralRe: SmtpMail question Pin
Rocky Moore16-Jan-04 19:13
Rocky Moore16-Jan-04 19:13 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 19:19
Mazdak16-Jan-04 19:19 
GeneralRe: SmtpMail question Pin
Rocky Moore16-Jan-04 19:34
Rocky Moore16-Jan-04 19:34 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 20:39
Mazdak16-Jan-04 20:39 
GeneralRe: SmtpMail question Pin
Mazdak16-Jan-04 22:14
Mazdak16-Jan-04 22:14 
GeneralRe: SmtpMail question Pin
Mazdak22-Jan-04 20:43
Mazdak22-Jan-04 20:43 
GeneralRe: SmtpMail question Pin
Mazdak22-Jan-04 20:43
Mazdak22-Jan-04 20:43 
GeneralRe: SmtpMail question Pin
Rocky Moore23-Jan-04 3:30
Rocky Moore23-Jan-04 3:30 
For me, I use this code. Works fine with my servers that require authentication.

public static bool SendEMail(string to, string from, string subject, string body)
{
   bool isOk = false;

   try
   {
      SmtpConfig.LogToText=false;

      MailMessage msg = new MailMessage(from,to);
      msg.Subject = subject;
      msg.Body = body;
      Smtp smtp = new Smtp("MyMailServer",25);
      smtp.Username="myUsername";
      smtp.Password="myPassword";
      smtp.SendMail(msg);
      isOk = true;
   }
   catch(MalformedAddressException mfa)
   {
      Debug.WriteLine("Address error occured: " + mfa.Message);
   }
   catch(SmtpException se)
   {
      Debug.WriteLine("Smtp error occured: " + se.Message);
   }
   catch(Exception ex)
   {
      Debug.WriteLine("Error occured: " + ex.Message );
   }

   return isOk;
}




Rocky <><
www.HintsAndTips.com
GeneralRe: SmtpMail question Pin
Mazdak23-Jan-04 4:21
Mazdak23-Jan-04 4:21 
Generalauthorize.net Pin
Biebster15-Jan-04 21:55
Biebster15-Jan-04 21:55 

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.