473,473 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SMTP IN VB.NET HELP

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("Me@MyDomain.Com",
"Yo*@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

May 10 '07 #1
1 2736


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.


<da*******@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
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("Me@MyDomain.Com",
"Yo*@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

May 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Hughes | last post by:
I wonder if anyone can help me resolve this problem. Although my ISP (One and One) provides the facility to run Python 2.2 CGI programs, their technical support people don't seem to have any Python...
2
by: RandRace | last post by:
I'm having some problems with a little script i wrote using net::smtp. I originally wrote it in linux where it works perfectly. I tried to use it from windows the other day and it doesn't work. It...
3
by: Shannon Clyde | last post by:
SMTP + relay + auth in an IPSEC tunnel to connect to our primary SMTP mail server (GroupWise) from the Web server looks like it would work fine, but is it the best way? I am aware of CDOSYS and...
7
by: Razzie | last post by:
Hey all, I need to connect to an SMTP server and get a notification when it gets a new mail to send. I want to be able to 'read' that email (retrieve recipient information for example). Is that...
1
by: bivin | last post by:
hai i am requesting your technical support. please help me. i have been working with this for five days. the problem is relating with the smtp. i am trying to send an email from the asp.net...
4
by: Tushar | last post by:
Please help: I found some of the following information in messeges in this group but I would like someone to confirm them please. I would like to use the following web-services / ASP.Net code to...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
11
by: ibiza | last post by:
Hi all, I am trying to use the System.Net.Mail class for the first time, with ASP.NET 2.0. I setup everything according to http://www.codeproject.com/aspnet/EasySMTP_package.asp, which gives...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.