473,657 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to test SMTP server connection in C#

108 New Member
Hi guys,
I would like to ask your idea on how to test my SMTP server connection. I created a form where you will input SMTP info like server, port, username and password. At the end of it, I added a test connection button. Right now, I can send email using SmtpClient and MailMessage class. I tried using socket to test the connection but our server don't accept connection. Hope you can help me guys.

Thanks in advance.
Sep 7 '08 #1
1 8695
Plater
7,872 Recognized Expert Expert
Wouldn't the SmtpClient be a good test?
Sep 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2804
by: Dan Boyle | last post by:
Hi, I am having difficulty connection to an smtp host. I am using the following code but I don't think I fully understand what smtp host can be used. function setSMTPParams($host = null, $port = null, $helo = null, $auth = null, $user = null, $pass = null) { if (!is_null($host)) $this->smtp_params = $host;
4
25407
by: Alex Hunsley | last post by:
I am using the smtp module to send emails via a local SMTP server on our network. I am failing with "connection refused" error, even though we definitely have an smtp server running on port 25! the code is like this: me = 'ahunsley@companyname.com' you = 'someonelse@companyname.com' msg = '*** alert'
2
3000
by: Karl Ehr | last post by:
I have written the following simple program to monitor a single URL, and notify me via email whenever this URL changes. Intermittently, I raise the following exception: Traceback (most recent call last): File "./urlwatch.py", line 34, in ? server.sendmail(sourceAddress, emailAddress, message) File "/usr/lib/python2.2/smtplib.py", line 621, in sendmail if not (200 <= self.ehlo() <= 299): File "/usr/lib/python2.2/smtplib.py", line...
1
8036
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 page. earlier it was showing send using not find error.
4
1370
by: ericvdb | last post by:
Hi all, how are you guys handling the deployment and settings from a test server to a production server? In particular, if I have a db connection in my web.config pointing to my test db server, do i need to modify it manualy on the productionserver once the site has been deployed? I have the same question for sql reporting services, but i'll post that in another forum.
5
23753
by: Chris | last post by:
I am trying to send email in C#. I wrote 2 pieces of code: 1. MailMessage mail = new MailMessage(); mail.From = "from_address"; mail.To = "to_address"; mail.Subject = "subject"; mail.BodyFormat = MailFormat.Text; mail.Body = "body"; SmtpMail.SmtpServer = "smtp.server"; mail.Fields.Clear();
7
7730
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 free edition for anti-virus. I use an ISP provider from my country and according to them I do not need to perform authentication while sending mails through their SMTP address. Thus I am using external SMTP server. I don't have IIS installed...
0
3213
by: Homer | last post by:
Hi, I got "InnerException: Unable to connect to remote server"..."No connection could be made because the target machine actively refused it" when I attempted to send an email through my Intranet app that is written in asp.net 2.0. The smtp server is a local server and it uses Port 25. The Authentication is set to Anonymous Access. Here's my code: <system.net>
3
5256
by: Sean Nakasone | last post by:
I'm having trouble with sending smtp mail. It's hanging after the smtplib.SMTP() line. It doesn't works from home but not from work. What's the best way to debug this? # Here's my script import smtplib msg = "Subject: Hello\n\nThis is the\nbody of the message." server = smtplib.SMTP("smtp.gmail.com",465) # "Connection refused" normally means there is no server listening for # connections on the specified IP/port-combination.
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8603
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.