Click here to Skip to main content
15,887,585 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert e to uppercase Pin
Aaron Eldreth14-May-04 10:09
Aaron Eldreth14-May-04 10:09 
GeneralRe: Convert e to uppercase Pin
XGaMeS17-May-04 2:46
XGaMeS17-May-04 2:46 
Generalhelp sending a form to bottom Pin
Stanimir_Stoyanov14-May-04 6:37
Stanimir_Stoyanov14-May-04 6:37 
GeneralRe: help sending a form to bottom Pin
f6414-May-04 7:51
f6414-May-04 7:51 
Generalsending email base on radiobuttonlist selection Pin
devgeez14-May-04 5:49
devgeez14-May-04 5:49 
GeneralRe: sending email base on radiobuttonlist selection Pin
Mike Ellison14-May-04 6:34
Mike Ellison14-May-04 6:34 
GeneralRe: sending email base on radiobuttonlist selection Pin
devgeez21-May-04 3:41
devgeez21-May-04 3:41 
GeneralRe: sending email base on radiobuttonlist selection Pin
Mike Ellison21-May-04 4:21
Mike Ellison21-May-04 4:21 
Hi there. I'm guessing you are new to VB.NET? maybe new to programming? Generally I'd say you're on the right track, but you would certainly make your life easier to create a sub or function with parameters for sending the message. It looks like (for the moment) that the only properties changing for the message are the subject and body, and those are constructed from boiler-plate strings with the location. So, you could create your sub for sending the message with the location as a parameter:
Public Sub SendAMessage(sLocation as string)
    dim Message As MailMessage = New MailMessage
    Message.From = "postmaster@test.net"
    Message.To = "me@test.net"
    Message.Cc = "you@test.net"
    Message.Bcc = "us@test.net"
     
    '--set subject and body depending on the location
    Message.Subject = sLocation
    Message.Body = string.Format( _
      "There is a new {0} Form that was submitted.  " & _
      "Please click on the following link:  " & _
      "http://test/testfolder/continents/Main.aspx", _
      sLocation)
       
    Try
        SmtpMail.SmtpServer = "TESTIMC01.TEST.com"
        SmtpMail.Send(Message)
    Catch ex As Exception
        'do something with the error...
        '... also, make sure to look at the
        '... InnerException property; in the case
        '... of mail exceptions, often InnerException
        '... will give some better information of
        '... what is going wrong
        dim innerEx as Exception = ex.InnerException
        if not (innerEx is nothing) then
            '--inspect the innerEx message... 
            '-- perhaps write out to the log            
        end if        
    End Try
End Sub
Then in your main sub you would inspect your RadioButtonList for its value and call the SendAMessage() sub with the proper location as a parameter. Again, assuming you have a RadioButtonList and not a CheckBoxList, then SelectedValue should work fine.
Public Sub InspectLocationAndSend()
    '--get the value of the selected radio button
    '-- this assumes the value is the desired location, like 'Europe'.
     
    dim sLocation as string = myRadioButtonList.SelectedValue
     
    '--Now call the sub that actually constructs and sends the message,
    '  based on the location
     
    SendAMessage(sLocation)
     
End Sub 
What book(s) are you using to learn VB.NET and ASP.NET?
GeneralRe: sending email base on radiobuttonlist selection Pin
devgeez21-May-04 4:31
devgeez21-May-04 4:31 
GeneralRe: sending email base on radiobuttonlist selection Pin
Mike Ellison21-May-04 6:28
Mike Ellison21-May-04 6:28 
GeneralFile Stream Headache Pin
BMS581914-May-04 5:01
BMS581914-May-04 5:01 
GeneralRe: File Stream Headache Pin
Anonymous16-May-04 11:11
Anonymous16-May-04 11:11 
GeneralRe: File Stream Headache - Permissions Problem ? Pin
BMS581917-May-04 3:34
BMS581917-May-04 3:34 
GeneralPjGrid.ocx - Dragging Tasks Pin
mac_hua14-May-04 3:30
mac_hua14-May-04 3:30 
GeneralSetup project for BHO Pin
Member 86274214-May-04 0:27
Member 86274214-May-04 0:27 
GeneralHelp....Datagrid and Ado question Pin
Anonymous13-May-04 23:38
Anonymous13-May-04 23:38 
GeneralHardware configuration Pin
pasho13-May-04 17:16
pasho13-May-04 17:16 
GeneralRe: Hardware configuration Pin
superwinsock13-May-04 22:31
superwinsock13-May-04 22:31 
GeneralRe: Hardware configuration Pin
Dave Kreskowiak14-May-04 8:11
mveDave Kreskowiak14-May-04 8:11 
GeneralRe: Hardware configuration Pin
pasho14-May-04 16:34
pasho14-May-04 16:34 
GeneralRe: Hardware configuration Pin
pasho14-May-04 16:38
pasho14-May-04 16:38 
GeneralMouse Wheel Scroll event in crystal report viewer Pin
Asif Rehman13-May-04 16:53
Asif Rehman13-May-04 16:53 
Generalstreamwriter problem Pin
Xun Ding13-May-04 9:50
Xun Ding13-May-04 9:50 
GeneralRe: streamwriter problem Pin
Daniel Turini13-May-04 10:22
Daniel Turini13-May-04 10:22 
GeneralRe: streamwriter problem Pin
Xun Ding13-May-04 10:48
Xun Ding13-May-04 10:48 

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.