(using System.Net.Mail)
hi
i have this code : - MailMessage myMail = new MailMessage("mail@mail.com", "mail@mail.com", "My Report.", "See the file.");
-
SmtpClient myccc = new SmtpClient("localhost");
-
myccc.Credentials = CredentialCache.DefaultNetworkCredentials;
-
myccc.Send(myMail);
its just tell me this message :
Failure sending mail <edit by mod: replaced email addresses with fake ones for your privacy> 19 2109
If you look at the details of the exception that is thrown you will see what SMTP command generated the error. that might tell you more about what went wrong.
i even look at it but its not helping
please someone help me
i need it so quick
Do you have a SMTP service installed and running as a Windows Service on the same machine defined as "localhost"?
Are you catching the exception as the base Exception or as an SmtpException?
The SmtpException will give you extended information about the failure.
no i haven't SMTP runing
sooo i need help give me a solution
Well if you don't have an smtp server running, how do you expect to connect to it?
Well if you don't have an smtp server running, how do you expect to connect to it?
then how can i run this thing ??
I can think of two ways:
Open up a command prompt (cmd)
and run: net start "Simple Mail Transfer Protocol (SMTP)"
Or run services.msc and look for the SMTP service and start it.
I can think of two ways:
Open up a command prompt (cmd)
and run:
net start "Simple Mail Transfer Protocol (SMTP)"
Or run services.msc and look for the SMTP service and start it.
I do like you said but its not working
i run in cmd : net start
then i run the code but the same problem
some more information would help as we can guess from the code but this may not always be correct as you may have just found the code and be trying to use it incorrectly
are you trying to send on a network that is using exchange servers?
are you trying to send from a specific smtp server?
if you are connecting to a smtp server where are you intending to get the logon details from as with exchange you can use your standard network credentials but I don't think you can with SMTP
I have sent some stuff via exchange so don't have a lot of experience with doing smtp but this information will help clarify things a bit
so i don't understand what are you mean exactly
but if you have another code than can i send an email please
tell me what is it
also you are pointing to your SMTP server as ' localhost ' which will redirect back to your PC, if you check the code you will see that it will usually point to a server running either exchange or an SMTP server, to confirm if it is runnning smtp you could try using telnet on port 25 unless it is set up for a different port
If you are making a WinForms app, you can do it using MAPI, and use MS Outlook (or other mail client) to send your mails.
Google for ".NET MAPI" (e.g. http://www.codeproject.com/KB/IP/SendFileToNET.aspx).
This way you don't have to worry about the SMTP server, but rather pass the mail to Outlook, which will then use its own stored account settings.
OK man thanks a lot, this will help
i wish you a good luck in your life
only problem with using outlook is that 2003 pops up a stupid message asking if you want to allow the email due to a security patch
you can bypass this by either using sendkeys to send Alt + S to send it or using a third paty dll or similar but unfortunately all the one's I have seen were quite expensive.
looking at the code I might be incorrect as the stuff I was using previously was using the office interop stuff so I might have to try that code out.
Thanks
I use outlook without poping up security prompts.
The prompt only pops up if you attempt to do a READ on any values.
If you only do writes, it won't popup.
As dumb as that sounds.
sounds odd, I was trying to create a message object , set the to and from etc and then send it so I am not fully sure what you mean by ' read ' but the code on the link looks quite different so I will have to have a look and see how it works
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul Lamonby |
last post by:
Hi,
I am sending a file from the server as an email attachment. The file
is being attached no problem and sending the email, but I get an error
when I try to open it saying it is corrupt....
|
by: praba kar |
last post by:
Dear All,
I have doubt regarding mail sending smtplib
module. The below code is I used to send a mail.
##########################################
import email.Message
import email.Utils...
|
by: VB Programmer |
last post by:
I have an ASPX page where I send out emails through my mail server
mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends
PERFECTLY. When I try sending an email to any other address...
|
by: Ant |
last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send
mail, however it's not sending any emails.
I'm using it on a Windows 2003 server.
The simplest way to use this is...
|
by: Eric Sheu |
last post by:
Greetings,
I have been searching the web like mad for a solution to my SMTP problem. I
am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a
web site I have created to...
|
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,...
|
by: JoeP |
last post by:
Hi All,
How can I find the reason for such an error: Failure sending mail.
Some Code...
oMailMessage.IsBodyHtml = False
oMailMessage.Body = cEmailBody
Dim oSMTP As New SmtpClient...
|
by: bleachie |
last post by:
Hey,
I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms.
i use this function to add more guestnames and guestemail fields based on the number of...
|
by: Markgoldin |
last post by:
I am sending an XML data from not dontnet process to a .Net via socket
listener.
Here is a data sample:
<VFPData>
<serverdata>
<coderun>updateFloor</coderun>
<area>MD2</area>...
|
by: happyse27 |
last post by:
Hi All,
I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
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...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
| |