PC Review


Reply
Thread Tools Rate Thread

SMTP IN VB.NET HELP

 
 
dansuthar@gmail.com
Guest
Posts: n/a
 
      10th May 2007
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:

Codeim client As New Net.Mail.SmtpClient("smtp.gmail.com")
Dim mm As New Net.Mail.MailMessage("(E-Mail Removed)",
"(E-Mail 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

 
Reply With Quote
 
 
 
 
sloan
Guest
Posts: n/a
 
      10th May 2007


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.




<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:
>
> Codeim client As New Net.Mail.SmtpClient("smtp.gmail.com")
> Dim mm As New Net.Mail.MailMessage("(E-Mail Removed)",
> "(E-Mail 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RFC 3207 (SMTP Service Extension for Secure SMTP over Transport Layer Security) - materials Piotrek Microsoft Windows 2000 Networking 0 26th Apr 2005 08:31 AM
Force outgoing SMTP to another SMTP server? Scott L Microsoft Outlook 3 22nd Dec 2004 03:35 PM
smtp service running but cant start SMTP Virtual Server ? scott Microsoft Windows 2000 1 24th Feb 2004 11:46 AM
Outlook SMTP and Express SMTP configuration help needed JeriLynn Microsoft Outlook 0 3rd Feb 2004 05:23 PM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:38 PM.