Hello, Guys:
Does anyone have experience in this situation?
First, I established a socket connection to a socks5 proxy Server through the use of Net::SOCKS module. Then I realized that I try to enable SSL in order to communicate with the gmail smtp server through the "STARTTLS" command.
Then I am lost, what should be done next in order to send an email through the socket?
Codes are as below:
use Net::SOCKS;
use Net::SSLeay;
use IO::Socket::INET;
use IO::Socket::SSL;
use MIME::Base64 qw[encode_base64 decode_base64];
use Digest::HMAC_MD5 qw[hmac_md5_hex];
my $sock = new Net::SOCKS(socks_addr => '211.239.124.76',
socks_port =>9188,
#user_id => 'the_user',
#user_password => 'the_password',
#force_nonanonymous => 0,
protocol_version => 5);
print "Cannot establish connection using socks!\n" if !$sock;
print "Connecting to google gmail now!\n";
my $f= $sock->connect(peer_addr => 'smtp.gmail.com',
peer_port => 587);
open FH, ">:utf8","socks.txt";
my $line=<$f>;
print $line ;
print FH $line;
print $f "EHLO localhost\n";
$line=<$f>;
print $line;
print FH $line;
print $f "StartTLS\n";
$line=<$f>;
print $line;
print FH $line;
#What is next?...
Thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.