Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMTP IN VB.NET HELP

1 view
Skip to first unread message

dans...@gmail.com

unread,
May 10, 2007, 12:35:16 PM5/10/07
to
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("M...@MyDomain.Com",
"Y...@YourDomain.com")
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

sloan

unread,
May 10, 2007, 1:47:08 PM5/10/07
to

See

http://sholliday.spaces.live.com/blog/
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)


to read about the authentication methods, and download code samples.


<dans...@gmail.com> wrote in message
news:1178814916.3...@o5g2000hsb.googlegroups.com...

0 new messages