ms2222 Posted November 23, 2009 at 12:28 AM Report Share #297251 Posted November 23, 2009 at 12:28 AM Boas... Preciso implementar o protocolo SMTP num cliente de sockets Berkley. Já procurei no site mas não encontrei. Alguém me poderia ajudar com código ou bibliografia na internet. Pesquisei no google mas não encontrei nada em concreto. Basicamente o que eu pretendo fazer é: Na linha de comando (linux) introduzo: ./cliente "servidor_de_email" 25 e de seguida deve-me ser pedido a origem o destino e a mensagem. Alguém me poderia ajudar? Obrigado Link to comment Share on other sites More sharing options...
Baderous Posted November 23, 2009 at 12:40 AM Report Share #297253 Posted November 23, 2009 at 12:40 AM Numa pesquisa rápida encontrei isto: http://snippets.dzone.com/posts/show/1896 http://docs.sun.com/source/816-6027-10/smrc.htm http://www.opensource.apple.com/source/fetchmail/fetchmail-7/fetchmail/smtp.h Vê se é útil. Link to comment Share on other sites More sharing options...
IceBrain Posted November 23, 2009 at 02:53 AM Report Share #297255 Posted November 23, 2009 at 02:53 AM Vê também o exemplo da Wikipédia, é bastante fácil de seguir: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol#SMTP_transport_example ❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents A list of command line apps Link to comment Share on other sites More sharing options...
Hipnoted Posted November 23, 2009 at 09:41 AM Report Share #297260 Posted November 23, 2009 at 09:41 AM Tens de ver como o protocolo funciona e para isso nada melhor que ir ver ao respectivo RFC: http://www.ietf.org/rfc/rfc0821.txt Depois de estudar isso é fazer a implementação por sockets. Tens alguns exemplos espalhados pelo fórum, e até na Revista PROGRAMAR. 🙂 "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência" Link to comment Share on other sites More sharing options...
ms2222 Posted November 24, 2009 at 12:35 AM Author Report Share #297368 Posted November 24, 2009 at 12:35 AM Obrigado a todos pela ajuda. Eu tenho conhecimentos sobre sockets e sobre o protocolo SMTP. O meu objectivo agora é juntar os dois. Actualmente tenho um socket que o que faz é quando executado o cliente para o porto 25 do servidor de SMTP pede para inserir a mensagem. Eu insiro por exemplo o primeiro código : Mail from:XXXXXXX e o servidor responde com uma frase de Ok. Mas assim linha a linha ainda não consegui enviar qualquer email. O que eu gostaria é que me fosse sendo pedido a informação (mail from:, rcpt to:, etc) e enviada para o servidor SMTP Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now