|
|
Home » U++ Library support » U++ MT-multithreading and servers » SmtpMail class
SmtpMail class [message #5624] |
Fri, 06 October 2006 11:04 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
Somebody has a tutorial or information about the SmtpMail class of the Package Web?
I had thought about using the classes defined in the jwSMTP library that I have found in sourceforge (http://johnwiggins.net/jwsmtp/) which they work fine and are easy to use.
Nevertheless I believe that the SmtpMail class can work better and is already integrated in U++, but is no type of documentation on how it is used.
Nico
[Updated on: Fri, 06 October 2006 11:04] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: SmtpMail class [message #5687 is a reply to message #5686] |
Mon, 09 October 2006 21:30 |
|
forlano
Messages: 1202 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
nicomesas wrote on Mon, 09 October 2006 21:17 |
But, what is and why you need unistd.h?
Nico
|
It is needed for some obscure reason by c_sinonyms.h.
Perhaps we should have a look to jwSMTP .
Luigi
[Updated on: Mon, 09 October 2006 21:32] Report message to a moderator
|
|
|
Re: SmtpMail class [message #5694 is a reply to message #5687] |
Tue, 10 October 2006 10:30 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
oooops!
I'm sorry. c_sinonyms.h. file is in csv repository of opensolaris an "empty" file. The content is writen for my and is the result of copy-paste from an example ...¿?
That file 'unistd.h' is not necessary, at least in linux. You can comment or delete the line.
Nico
[Updated on: Tue, 10 October 2006 10:31] Report message to a moderator
|
|
|
|
|
|
Re: SmtpMail class [message #5761 is a reply to message #5704] |
Fri, 13 October 2006 13:28 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
EOH Luigi!
I have looked for information about all this and have found documents (he is Spanish) that say to me that in Windows we need to include the file winsock.h has to use the unique include file.
Take a look to the next code present in Web/socket.h
#if defined(PLATFORM_WIN32)
#define W_P(w, p) w
#if !defined(PLATFORM_CYGWIN)
#include <winsock2.h>
#endif
typedef int socklen_t;
#elif defined(PLATFORM_POSIX)
#define W_P(w, p) p
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
//#include <libiberty.h>
enum
{
INVALID_SOCKET = -1,
TCP_NODELAY = 1,
SD_RECEIVE = 0,
SD_SEND = 1,
SD_BOTH = 2,
};
typedef int SOCKET;
#else
#error Unsupported platform
#endif//PLATFORM switch
May be you can test it in windoz!
The idea comes from this page http://www.arrakis.es/~dmrq/beej/intro.html#windows.
In order to translate it of automatic form (it is not perfect, but enough aid) you could use the following address http://babelfish.altavista.com/tr
Nico
|
|
|
|
|
Re: SmtpMail class [message #5778 is a reply to message #5766] |
Sun, 15 October 2006 23:13 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
Hello Luigi
This weekend I have investigated a little plus the subject this of the SmtpMail class and have for of conclusions that I believe that they are important.
In Linux I can use the class to directly send mail to the adressees (using the resolv library) who we could make an effort to us in port to Windows... but arises the problem from which if we used this method, then the servers think that the machine that sends the mail it have a virus of which they send Spam and they mark the IP like spamer.
At sight of this problem I see clear that we will not be able to use this method in the future (and in Windows either in the present) so I have myself I decide to use the classic method of mail shipment, that is to say, happening through a real smtp server.
This enough difficult me the management of the send-errors in my program, but the mails arrive at least at their destiny.
For it I have as much been using the class jwSMTP that works very well, in linux and Windows, but it has the problem of which the license is GPL. Well, for my it is not problem, but it would prefer to use a class better integrated in U++.
The case is that I have extracted of the class jwSMTP the code that serves to autentificate (to do login) in smtp server, I have added it class to the SmtpMail and.... it works!
I have created a class new "SmtpMailEx" to test here and you the shipment so that you prove it in Windows to see what happens.
If this works, I believe that we could propose to Mirek to add these functions to the original class, and of step to put the messages that are in cheko in English or to use the method of standard translation.
In any case you have the class here.
Nico
-
Attachment: smtpEx.zip
(Size: 4.75KB, Downloaded 1973 times)
|
|
|
Re: SmtpMail class [message #5780 is a reply to message #5778] |
Mon, 16 October 2006 00:27 |
|
forlano
Messages: 1202 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
nicomesas wrote on Sun, 15 October 2006 23:13 | Hello Luigi
This weekend I have investigated a little plus the subject this of the SmtpMail class and have for of conclusions that I believe that they are important.
In Linux I can use the class to directly send mail to the adressees (using the resolv library) who we could make an effort to us in port to Windows... but arises the problem from which if we used this method, then the servers think that the machine that sends the mail it have a virus of which they send Spam and they mark the IP like spamer.
At sight of this problem I see clear that we will not be able to use this method in the future (and in Windows either in the present) so I have myself I decide to use the classic method of mail shipment, that is to say, happening through a real smtp server.
This enough difficult me the management of the send-errors in my program, but the mails arrive at least at their destiny.
For it I have as much been using the class jwSMTP that works very well, in linux and Windows, but it has the problem of which the license is GPL. Well, for my it is not problem, but it would prefer to use a class better integrated in U++.
The case is that I have extracted of the class jwSMTP the code that serves to autentificate (to do login) in smtp server, I have added it class to the SmtpMail and.... it works!
I have created a class new "SmtpMailEx" to test here and you the shipment so that you prove it in Windows to see what happens.
If this works, I believe that we could propose to Mirek to add these functions to the original class, and of step to put the messages that are in cheko in English or to use the method of standard translation.
In any case you have the class here.
Nico
|
Ciao Nico!
Congratulation for your new achievement. Your news are very good.
Unfortunately I'm a bit confused. Your new class substitute the old one in the current U++ distribution?
Moreover, which test case have I to use to see this class in action?
You posted different versions and I do not knwo what to do.
Luigi
|
|
|
|
|
Goto Forum:
Current Time: Sun Nov 10 21:05:16 CET 2024
Total time taken to generate the page: 0.01780 seconds
|
|
|