Click here to Skip to main content
15,882,241 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: authorize.net Pin
Heath Stewart16-Jan-04 4:16
protectorHeath Stewart16-Jan-04 4:16 
GeneralConfigure folder permission and virtual directory Pin
SandyJ15-Jan-04 21:07
SandyJ15-Jan-04 21:07 
GeneralRe: Configure folder permission and virtual directory Pin
Mazdak15-Jan-04 22:10
Mazdak15-Jan-04 22:10 
GeneralOffice development problem Pin
miniztry15-Jan-04 14:55
miniztry15-Jan-04 14:55 
GeneralRe: Office development problem Pin
Heath Stewart16-Jan-04 4:15
protectorHeath Stewart16-Jan-04 4:15 
GeneralBorland c# 1.0 Easter Egg Pin
kbsoftware15-Jan-04 13:54
kbsoftware15-Jan-04 13:54 
GeneralChanging Folder Permissions C# Pin
Nicholas Cardi15-Jan-04 13:11
Nicholas Cardi15-Jan-04 13:11 
GeneralRe: Changing Folder Permissions C# Pin
Mazdak15-Jan-04 22:13
Mazdak15-Jan-04 22:13 
GeneralRe: Changing Folder Permissions C# Pin
Heath Stewart16-Jan-04 4:08
protectorHeath Stewart16-Jan-04 4:08 
GeneralRe: Changing Folder Permissions C# Pin
Nicholas Cardi17-Jan-04 4:40
Nicholas Cardi17-Jan-04 4:40 
GeneralRe: Changing Folder Permissions C# Pin
Heath Stewart17-Jan-04 8:44
protectorHeath Stewart17-Jan-04 8:44 
QuestionHow to convert a float to a 4 byte array. Pin
HAHAHA_NEXT15-Jan-04 10:56
HAHAHA_NEXT15-Jan-04 10:56 
AnswerRe: How to convert a float to a 4 byte array. Pin
leppie15-Jan-04 11:07
leppie15-Jan-04 11:07 
GeneralRe: How to convert a float to a 4 byte array. Pin
HAHAHA_NEXT16-Jan-04 10:12
HAHAHA_NEXT16-Jan-04 10:12 
GeneralSqlParameter.IsNullable Pin
Shaun Becker15-Jan-04 10:20
Shaun Becker15-Jan-04 10:20 

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.