SMTP IN VB.NET HELP

D

dansuthar

Hi everyone there,
I want some help in sending mails using .net 2.0 form vb.net.
i use the following code to send SMTP Mails:

Code:Dim client As New Net.Mail.SmtpClient("smtp.gmail.com")
Dim mm As New Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)")
mm.Body = "<h1>Hello World</h1>"
Dim client As New Net.Mail.SmtpClient("mail.MyDomain.com")
client.Credentials = New Net.NetworkCredential("MyUserName",
"MyPassword")
client.Send(mm)


Now , I have made an app (LIKE SMTP MAIL CLIENT) that takes user's
username and password to send e-mails.. But, The problem is that if
the user (by mistake!) enters worng id or password then My app returns
an error only when the user tries to send the email ! But what i want
is to make is a login at "statup" so user enters id and password at
startup and my app tries to LOGIN to the server and if id or password
is wrong then my app will shows the error of wrong information at just
on the startup (Not while send e-mails - - like most of messangers
have !)

I tries very much but can't find anyting (Something Like client.login
like I used client.Send(mm) !! )

Any Idea ??

Regards,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top