Click here to Skip to main content
15,925,206 members
Home / Discussions / C#
   

C#

 
Questionenum with string array Pin
saymajum10-Jul-07 14:54
saymajum10-Jul-07 14:54 
AnswerRe: enum with string array Pin
PIEBALDconsult10-Jul-07 15:13
mvePIEBALDconsult10-Jul-07 15:13 
Questionc# error handling [modified] Pin
daku110-Jul-07 14:19
daku110-Jul-07 14:19 
AnswerRe: c# error handling Pin
Paul Conrad13-Jul-07 12:04
professionalPaul Conrad13-Jul-07 12:04 
QuestionUsing global hooks to respond to another application's events Pin
Melvinivitch10-Jul-07 13:08
Melvinivitch10-Jul-07 13:08 
AnswerRe: Most likely deployment problem Pin
Colin Angus Mackay10-Jul-07 13:35
Colin Angus Mackay10-Jul-07 13:35 
QuestionSend email thru Exchange Server in C# Pin
Brad Wick10-Jul-07 12:45
Brad Wick10-Jul-07 12:45 
AnswerRe: Send email thru Exchange Server in C# Pin
PIEBALDconsult10-Jul-07 15:21
mvePIEBALDconsult10-Jul-07 15:21 
Here's what I use to send email:

C#
public static void
SendEmail
(
    string               Sender
,
    string               Recipient
,
    string               Subject
,
    string               Body
,
    string               SmtpServer
,
    System.IO.FileInfo[] Files
)
{
    System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage ( Sender , Recipient ) ;

    if ( Files != null )
    {
        System.Text.StringBuilder temp = new System.Text.StringBuilder ( Body ) ;

        temp.Append ( string.Format
        (
            "\n\n{0} attached file{1}:"
        ,
            Files.Length
        ,
            Files.Length==1?"":"s"
        ) ) ;

        foreach ( System.IO.FileInfo att in Files )
        {
            if ( att != null )
            {
                temp.Append ( "\n" + att.Name ) ;

                if ( att.Exists )
                {
                    msg.Attachments.Add ( new System.Net.Mail.Attachment ( att.FullName ) ) ;
                }
                else
                {
                    temp.Append ( " -- does not exist!" ) ;
                }
            }
        }

        Body = temp.ToString() ;
    }

    msg.Subject = Subject ;
    msg.Body    = Body ;

    System.Net.Mail.SmtpClient cl = new System.Net.Mail.SmtpClient ( SmtpServer ) ;
    cl.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials ;
    cl.Send ( msg ) ;
}

GeneralRe: Send email thru Exchange Server in C# Pin
Brad Wick10-Jul-07 19:53
Brad Wick10-Jul-07 19:53 
GeneralRe: Send email thru Exchange Server in C# Pin
PIEBALDconsult11-Jul-07 12:50
mvePIEBALDconsult11-Jul-07 12:50 
AnswerRe: Send email thru Exchange Server in C# Pin
Jimmanuel10-Jul-07 15:43
Jimmanuel10-Jul-07 15:43 
QuestionHow t store the values in arraylist in c# Pin
sdev8510-Jul-07 12:02
sdev8510-Jul-07 12:02 
AnswerRe: How t store the values in arraylist in c# Pin
InOut.NET10-Jul-07 13:27
InOut.NET10-Jul-07 13:27 
QuestioniTunes SDK - Database Change Event Pin
MicealG10-Jul-07 11:31
MicealG10-Jul-07 11:31 
QuestionControlling an application from another. Pin
coder87c10-Jul-07 11:09
coder87c10-Jul-07 11:09 
AnswerRe: Controlling an application from another. Pin
Diana Fernandez10-Jul-07 18:06
Diana Fernandez10-Jul-07 18:06 
QuestionRespond to other application window's resize event Pin
Melvinivitch10-Jul-07 10:35
Melvinivitch10-Jul-07 10:35 
AnswerRe: Respond to other application window's resize event Pin
User 665810-Jul-07 10:47
User 665810-Jul-07 10:47 
AnswerRe: Respond to other application window's resize event Pin
Giorgi Dalakishvili10-Jul-07 10:50
mentorGiorgi Dalakishvili10-Jul-07 10:50 
QuestionDataGridView Link Cell Pin
rahvyn610-Jul-07 9:36
rahvyn610-Jul-07 9:36 
AnswerRe: DataGridView Link Cell Pin
Ketty Avashia10-Jul-07 9:48
Ketty Avashia10-Jul-07 9:48 
GeneralRe: DataGridView Link Cell Pin
rahvyn610-Jul-07 9:49
rahvyn610-Jul-07 9:49 
GeneralRe: DataGridView Link Cell Pin
Ketty Avashia10-Jul-07 10:02
Ketty Avashia10-Jul-07 10:02 
GeneralRe: DataGridView Link Cell Pin
rahvyn610-Jul-07 10:13
rahvyn610-Jul-07 10:13 
GeneralRe: DataGridView Link Cell Pin
rahvyn610-Jul-07 10:28
rahvyn610-Jul-07 10:28 

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.