Advertisement
Guest User

NMail Include

a guest
May 1st, 2015
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.99 KB | None | 0 0
  1. #if !defined _samp_included
  2.     #error "N-Mail: Defina A_SAMP!"
  3. #endif
  4.  
  5. #include a_http
  6.  
  7. #if !defined n_mail_include
  8.     #define n_mail_include
  9. #endif
  10.  
  11. #define URL_ENVIOEMAIL "br-me.net/publico/nmail/index.php" // Altere
  12.  
  13. #define SMTP_HOST "br-me.net" // Altere
  14. #define SMTP_PORTA 25 // Altere
  15.  
  16. new nmail_http_request, m_mailmail[1024];
  17.  
  18. /*
  19.     native SendEmail(de[], para[], titulo[], mensagem[], charset[] = "utf-8", type[]="text/html");
  20.     native SendEmailSMTP(user_smtp[], senha_smtp[], para[], titulo[], mensagem[], host_smtp[]=SMTP_HOST, porta_smtp=SMTP_PORTA, authtype_smtp[] = "PLAIN", charset[] = "utf-8", type[]="text/html");
  21. */
  22.  
  23. forward Mail_HTTP(index, response_code, data[]);
  24. stock SendEmail(de[], para[], titulo[], mensagem[], charset[]="utf-8", type[]="text/html") {
  25.     format(m_mailmail, sizeof(m_mailmail), "de=%s&para=%s&tit=%s&msg=%s&charset=%s&type=%s", de, para, titulo, mensagem, charset, type);
  26.     return HTTP(nmail_http_request, HTTP_POST, URL_ENVIOEMAIL, m_mailmail, "Mail_HTTP");
  27. }
  28. stock SendEmailSMTP(user_smtp[], senha_smtp[], para[], titulo[], mensagem[], host_smtp[]=SMTP_HOST, porta_smtp = SMTP_PORTA, authtype_smtp[] = "PLAIN", charset[]="utf-8", type[]="text/html") {
  29.     format(m_mailmail, sizeof(m_mailmail),"de=%s&senha=%s&para=%s&tit=%s&msg=%s&host=%s&porta=%i&auth=%s&charset=%s&type=%s", user_smtp, senha_smtp, para, titulo, mensagem, host_smtp, porta_smtp, authtype_smtp, charset, type);
  30.     return HTTP(nmail_http_request, HTTP_POST, ""#URL_ENVIOEMAIL"?autenticado=1", m_mailmail, "Mail_HTTP");
  31. }
  32.  
  33. public Mail_HTTP(index, response_code, data[]) {
  34.     nmail_http_request++;
  35.     if(strlen(data) > 0)
  36.         printf("[NMail] Script: %s", data);
  37.     return 1;
  38. }
  39.  
  40. /*
  41.     Necessário os arquivos para o envio de e-mails.
  42.     Em uma hospedagem pública, você pode usar outros smtp's
  43.  
  44.     ////////////////////////////////////////////////////
  45.     ////        www.brasilmegatrucker.com            ///
  46.     ////////////////////////////////////////////////////
  47. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement