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

Visual Basic

 
GeneralRe: program codes in vb - quiz with randomized questions Pin
Colin Angus Mackay27-Feb-07 4:50
Colin Angus Mackay27-Feb-07 4:50 
GeneralRe: program codes in vb - quiz with randomized questions Pin
Dave Kreskowiak27-Feb-07 6:21
mveDave Kreskowiak27-Feb-07 6:21 
GeneralRe: program codes in vb - quiz with randomized questions Pin
Colin Angus Mackay27-Feb-07 6:50
Colin Angus Mackay27-Feb-07 6:50 
GeneralRe: program codes in vb - quiz with randomized questions Pin
Christian Graus27-Feb-07 9:26
protectorChristian Graus27-Feb-07 9:26 
GeneralRe: program codes in vb - quiz with randomized questions Pin
Dave Kreskowiak27-Feb-07 10:17
mveDave Kreskowiak27-Feb-07 10:17 
Questionemail sending using exchange server 2003 and VS 2005 Pin
steve_rm27-Feb-07 3:42
steve_rm27-Feb-07 3:42 
AnswerRe: email sending using exchange server 2003 and VS 2005 Pin
JustmeNick27-Feb-07 6:15
JustmeNick27-Feb-07 6:15 
QuestionRe: email sending using exchange server 2003 and VS 2005 Pin
steve_rm27-Feb-07 17:29
steve_rm27-Feb-07 17:29 
Hello,

Thanks for your help. The code i used is below. But I got a warning saying that using system.web.mail is obsolete and system.net.mail is the recommended to be used instead.

Also using the MS Exchange is very slow, i tried to send an e-mail to my hotmail and gmail account it takes more than 10 minutes to get there.

Is there any setting on the microsoft exchange server that need to be set?

Another quick question, is there a way to get the server name and the e-mail account automatically instead of a user inputting in? They can just click the send button.

Many thanks for your time,

Steve

Code for using system.web.mail
<br />
 Private Sub btnSendExchangeServer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendExchangeServer.Click<br />
        Dim mailMsg As New MailMessage()<br />
<br />
        mailMsg.To = "steve@clarityform.com"<br />
        mailMsg.From = "steve@clarityform.com"<br />
        mailMsg.Subject = "2nd Microsoft Exchange Server Mail Test"<br />
        mailMsg.Body = "This email came from MS Exchange Server"<br />
<br />
        Try<br />
            SmtpMail.SmtpServer = "cf01.clarityforms.com"<br />
            SmtpMail.Send(mailMsg)<br />
<br />
        Catch ex As Net.Mail.SmtpException<br />
            MessageBox.Show(ex.Message)<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        End Try<br />
<br />
    End Sub<br />
End Class<br />


Code for using gmail smpt server using system.net.mail
<br />
Private Sub btnSendMail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendMail.Click<br />
        Dim msgTo As New MailAddress("steve@clarityforms.com")<br />
        Dim msgFrom As New MailAddress("steve@clarityforms.com")<br />
        Dim msgSender As New MailAddress("steve@clarityforms.com")<br />
<br />
        Dim mailMsg As New MailMessage()<br />
        mailMsg.Sender = msgSender<br />
        mailMsg.To.Add(msgTo)<br />
        mailMsg.Priority = MailPriority.High<br />
        mailMsg.CC.Add("Steve1_rm@yahoo.com")<br />
        mailMsg.Subject = "This is a mail test"<br />
        mailMsg.Body = "This is the body of the e-mail, Enjoy"<br />
        mailMsg.From = msgFrom<br />
<br />
        Dim client As New SmtpClient("smtp.gmail.com", 587)<br />
        client.Credentials = New System.Net.NetworkCredential("steve1.rm@gmail.com", "1apple2")<br />
        client.EnableSsl = True<br />
<br />
        Try<br />
            client.Send(mailMsg)<br />
        Catch ex As SmtpException<br />
            MessageBox.Show(ex.Message)<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        End Try<br />
<br />
    End Sub<br />

Questiondeleting a database Pin
balakpn27-Feb-07 3:19
balakpn27-Feb-07 3:19 
AnswerRe: deleting a database Pin
Marcus J. Smith27-Feb-07 3:22
professionalMarcus J. Smith27-Feb-07 3:22 
GeneralRe: deleting a database Pin
Colin Angus Mackay27-Feb-07 4:10
Colin Angus Mackay27-Feb-07 4:10 
GeneralRe: deleting a database Pin
Marcus J. Smith27-Feb-07 4:28
professionalMarcus J. Smith27-Feb-07 4:28 
GeneralRe: deleting a database Pin
Colin Angus Mackay27-Feb-07 4:49
Colin Angus Mackay27-Feb-07 4:49 
GeneralRe: deleting a database Pin
Marcus J. Smith27-Feb-07 5:07
professionalMarcus J. Smith27-Feb-07 5:07 
GeneralRe: deleting a database Pin
Colin Angus Mackay27-Feb-07 6:09
Colin Angus Mackay27-Feb-07 6:09 
AnswerRe: deleting a database Pin
Colin Angus Mackay27-Feb-07 4:11
Colin Angus Mackay27-Feb-07 4:11 
Questionslashes in textbox Pin
amaneet27-Feb-07 2:27
amaneet27-Feb-07 2:27 
AnswerRe: slashes in textbox Pin
Marcus J. Smith27-Feb-07 2:38
professionalMarcus J. Smith27-Feb-07 2:38 
AnswerRe: slashes in textbox Pin
KeithF27-Feb-07 2:57
KeithF27-Feb-07 2:57 
GeneralRe: slashes in textbox Pin
Marcus J. Smith27-Feb-07 3:16
professionalMarcus J. Smith27-Feb-07 3:16 
AnswerRe: slashes in textbox Pin
JustmeNick27-Feb-07 6:05
JustmeNick27-Feb-07 6:05 
GeneralRe: slashes in textbox Pin
Marcus J. Smith27-Feb-07 7:56
professionalMarcus J. Smith27-Feb-07 7:56 
GeneralRe: slashes in textbox Pin
JustmeNick27-Feb-07 8:15
JustmeNick27-Feb-07 8:15 
QuestionReferential classes Pin
amaneet27-Feb-07 2:17
amaneet27-Feb-07 2:17 
QuestionMybase keyword Pin
Pankaj Garg27-Feb-07 1:57
Pankaj Garg27-Feb-07 1:57 

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.