|
How do you send an email message using C# WITHOUT using System.Web.Mail namespace?
I have a windows service that does some monitoring and I want it to send out an email after some trigger.
Thanks in advance,
David
P.S. AGAIN...WITHOUT USING THE SYSTEM.WEB.MAIL NAMESPACE!!!!!!
|
|
|
|
|
|
|
OpenSmtp on SourceForge does a nice job and it works on all Win platforms and it does NOT use THE SYSTEM.WEB.MAIL NAMESPACE!!!!!!
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
Have you tried System.Web.Mail?
PS - If that doesn't work, try System.Web.Mail.
|
|
|
|
|
You need to use sockets library to initiate a tcp/ip connection over port 25 and supply the necessary SMTP commands to send an email. This requires an SMTP server though.
It shouldn't be hard to code a simple email sending application but if you would like to use features like mime emails, attachments etc, you'll need an emailing component like devMail.Net- http://www.devmail.net[^]
Hakan 
|
|
|
|
|
I didnt mean for my post to stir up so many flames, I just wanted to make sure that I didnt get responses saying to use the system.web.mail namespace as I did in previous postings.
Thanks for the commerical suggestions.
I did find the following:
http://www.c-sharpcorner.com/internet/simpleSMTPMailer.asp
|
|
|
|
|
I am desperate for help! This is really eating my breakfast, lunch and dinner!
I have a class I have derived from the native ListView class. I have a context menu that I show when the user right clicks on a selected item in the list. When they select the "Delete" option in the context menu, I do a ListView.RemoveAt(index) where index is the index of the item they selected. The remove at works, but when the method returns control to the operating system, I get an unhandled exception with the following exception text.
************** Exception Text **************
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: '0' is not a valid value for 'displayIndex'.
at System.Windows.Forms.ListViewItemCollection.get_Item(Int32 displayIndex)
at System.Windows.Forms.ListView.LvnBeginDrag(MouseButtons buttons, NMLISTVIEW nmlv)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I can find no place in the remainder of my code where I am trying to attempt to access an item from the listview. Can anyone help decipher what my problem is?
dpb
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
|
It has to do with the fact that there is no item in the place of the one that I removed (i.e. - I only get the error when it is the only item in the list or the last item in the list).
However, I have tried to select a different item (via ListView1.Items[removedIndex-1].Selected=true) when I have multiple items in the list, but I still get the error.
Any further help would be greatly appreciated!
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
|
I miss how I could look at just the header file to see all the class methods. Yes, sometimes there was a lot of inline "clutter", but for the most part, I could get a "at a glance" concept of the class.
Yes, there's the outlining capability, but I find it annoying to use. Lots of mouse clicks, it would be nice if I could set it to always collapse when I load file, etc. Yes, there's the XML documentation capability, but that's if I or someone who wrote the class actually documented the functions in that way (of course, we all should!)
What was the rational behind separating definition from implementation?
Marc
|
|
|
|
|
Oops. I meant, "what was the rational behind merging definition with implementation?
Marc
|
|
|
|
|
You have the ClassView to see all those thingies. (the Group by type is the nicest sorting).
You may write interfaces in separate .cs files, which is actually what C++ headers stand for.
That said, I have to agree I have yet to see a single sample using interfaces (not for marshalling).
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
Thanks for the info! I never used the ClassView in VC6, so I totally forgot about that feature. On further investigation, I also noted that the object browser displays the XML comment tags for the different types.
Marc
|
|
|
|
|
I find the Object Browser extremely helpful
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
leppie wrote:
I find the Object Browser extremely helpful
The Object Browser come from VB. There are many people that will stop using it now, because of this information. As you can see there *are* some coll things from VB
Ñ There is only one MP Ð
|
|
|
|
|
Maciej Pirog wrote:
There are many people that will stop using it now, because of this information.
Why do you say that? And what infomation are you talking about?
Sorry, but I am a bit confused
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
leppie wrote:
And what infomation are you talking about?
That the Object Browser come from VB. That was a joke about people who are talking that VB is a sh*t but know nothing about it.
Ñ There is only one MP Ð
|
|
|
|
|
You can set it to collapse when you open the file...can't remember where it was cause I'm on my Mom's computer right now...but I'll look for it later this afternoon.
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
Hello, the codegurus around the world.;)
I have the same opinion as yours when I started Java and C# in the past.
In MFC, the header file as well as the message map are a good expression
to trace the code.
However, I found that MSFT provides us the very useful tool to save the lines
by + ---- - by #region syntax.
- #region Declare the event like Message Map
|
|
|
|
#endregion
will become
+ Declare the event like Message Map
But, I am still missing the header file a little bit.
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
-Masaaki Onishi-
|
|
|
|
|
That's the big tooltip that makes it fine.
She's so dirty, she threw a boomerang and it wouldn't even come back.
|
|
|
|
|
I am trying to write a program that sends data from a DataTable to an Microsoft Access Database (mdb format) using an OleDBConnection. The regional settings of my computer are set to "Greek". The problem is that the decimal numbers stored in the datatable cannot be transferred correctly to the Access Database. For example, the numer 15.34 (where "." is the decimal point for the US Regional Settings) is stored as 15.340,00 (where "," is the decimal point for the Greek Regional Settings).
I have tried to set the regional settings from inside the source code (using the CurrentThread.CultureInfo to "Greek") but that only applies to System.String values, and NOT decimal or floating point. For this reason, the values cannot be stored correctly into the Access DB file. The only way to correct this problem is to manually change the regional settings from the Control Panel, but I would like to avoid this solution.
I would appreciate it if you could help me with this issue.
Thank you in advance...
Dimitris A.
|
|
|
|
|
I had a similar problem some weeks ago using MSDE. I was storing dates using DateTime.ToLongDateString() and DateTime.ToShortTimeString(), but I found out that it generated an exception on systems where Windows was localized to Spanish (dates in Mexico are DD/MM/YYYY as oppossed to MM/DD/YYYY).
What I did was to manually construct the date string using DateTime properties (Month, Day and so on) and it worked well on both my English development machine and those in Spanish where it was tested.
But I did not find a more elegant way to do this.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
You can just format the date using an ANSI standard format (YYYY-MM-DD), I've never found a system/regional setting that doesn't understand that one correctly.
Contract Software Developer: andrew_lewis@mail.com
|
|
|
|