Click here to Skip to main content
15,889,909 members
Home / Discussions / C#
   

C#

 
GeneralRe: oh yes, using 'dynamic will do something special for you ! Pin
BillWoodruff28-Aug-12 14:58
professionalBillWoodruff28-Aug-12 14:58 
AnswerRe: oh yes, using 'dynamic will do something special for you ! Pin
DaveyM6928-Aug-12 4:15
professionalDaveyM6928-Aug-12 4:15 
GeneralRe: oh yes, using 'dynamic will do something special for you ! Pin
BillWoodruff28-Aug-12 15:09
professionalBillWoodruff28-Aug-12 15:09 
GeneralRe: oh yes, using 'dynamic will do something special for you ! Pin
DaveyM6928-Aug-12 21:24
professionalDaveyM6928-Aug-12 21:24 
QuestionMailMessage syntax with using statement Pin
thewazz27-Aug-12 10:46
professionalthewazz27-Aug-12 10:46 
AnswerRe: MailMessage syntax with using statement Pin
Eddy Vluggen27-Aug-12 11:01
professionalEddy Vluggen27-Aug-12 11:01 
AnswerRe: MailMessage syntax with using statement Pin
Wes Aday27-Aug-12 11:03
professionalWes Aday27-Aug-12 11:03 
GeneralRe: MailMessage syntax with using statement Pin
thewazz27-Aug-12 12:32
professionalthewazz27-Aug-12 12:32 
thanks. so i have this now:
using ( MailMessage message = new MailMessage()
            {
                // set message-object properties.
                From = new MailAddress("mailX@website.com", "it's me."),
                Subject = subject,
                Body = userMessage
            })
            {
                message.To.Add(new MailAddress(_strMailAddressX, "FromX"));
                message.To.Add(new MailAddress(_strMailAddressY, "FromY"));               

                SmtpClient mailClient = new SmtpClient();
                mailClient.Send(message);
            }
            return true;
all of that is wrapped in a try block. now,

- i could not get the 'To.Add' part to work without 'message.To.Add'. it wouldn't work at all inside the block that sets the other properties. i see that 'To' is a collection but i'm surprised i couldn't add to it while setting the other props.
- it kind of looks like the 'using' portion ends half-way through, when the right parenthesis closes. i tried other places but couldn't get anything else to work. at what point does it actually end here? is the 'using' stmt set up properly now?

- 'return true' is there because i'm setting this up in a class that'll return a bool. all comments appreciated.
tnx.
QuestionPlay Incoming Message Notification Pin
Jassim Rahma27-Aug-12 10:43
Jassim Rahma27-Aug-12 10:43 
AnswerRe: Play Incoming Message Notification Pin
Wes Aday27-Aug-12 10:45
professionalWes Aday27-Aug-12 10:45 
GeneralRe: Play Incoming Message Notification Pin
Jassim Rahma27-Aug-12 10:52
Jassim Rahma27-Aug-12 10:52 
GeneralRe: Play Incoming Message Notification Pin
Wes Aday27-Aug-12 11:00
professionalWes Aday27-Aug-12 11:00 
AnswerRe: Play Incoming Message Notification Pin
Eddy Vluggen27-Aug-12 11:08
professionalEddy Vluggen27-Aug-12 11:08 
GeneralRe: Play Incoming Message Notification Pin
Wes Aday27-Aug-12 11:15
professionalWes Aday27-Aug-12 11:15 
GeneralRe: Play Incoming Message Notification Pin
Eddy Vluggen27-Aug-12 11:22
professionalEddy Vluggen27-Aug-12 11:22 
QuestionSidebar using MDI Child Pin
Jassim Rahma27-Aug-12 10:35
Jassim Rahma27-Aug-12 10:35 
AnswerRe: Sidebar using MDI Child Pin
Eddy Vluggen27-Aug-12 10:58
professionalEddy Vluggen27-Aug-12 10:58 
GeneralRe: Sidebar using MDI Child Pin
Jassim Rahma28-Aug-12 10:40
Jassim Rahma28-Aug-12 10:40 
QuestionBest way to get notification from Sql server ?!? Pin
EgyptianRobot27-Aug-12 9:11
EgyptianRobot27-Aug-12 9:11 
AnswerRe: Best way to get notification from Sql server ?!? Pin
fjdiewornncalwe27-Aug-12 9:17
professionalfjdiewornncalwe27-Aug-12 9:17 
GeneralRe: Best way to get notification from Sql server ?!? Pin
EgyptianRobot27-Aug-12 21:31
EgyptianRobot27-Aug-12 21:31 
GeneralRe: Best way to get notification from Sql server ?!? Pin
fjdiewornncalwe28-Aug-12 3:56
professionalfjdiewornncalwe28-Aug-12 3:56 
GeneralRe: Best way to get notification from Sql server ?!? Pin
EgyptianRobot28-Aug-12 4:10
EgyptianRobot28-Aug-12 4:10 
GeneralRe: Best way to get notification from Sql server ?!? Pin
fjdiewornncalwe28-Aug-12 5:01
professionalfjdiewornncalwe28-Aug-12 5:01 
AnswerRe: Best way to get notification from Sql server ?!? Pin
Eddy Vluggen27-Aug-12 9:45
professionalEddy Vluggen27-Aug-12 9:45 

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.