well i was able to, using socket after searching on google thanks to google for the insight, am new to perl i was sure it's possible cos this happen in php

#!/usr/bin/perl -w use strict; use IO::Socket::INET; use MIME::Base64; my $cr = pack('H*','0D'); my $lf = pack('H*','0A'); #following http://www.perlmonks.org/bare/?node_id=316023 # see RFC 821 http://www.ietf.org/rfc/rfc0821.txt my($username) = 'email'; my($password) = 'password'; my($from) = 'email'; my($from_name) = 'name'; my($to) = 'email to send to'; my($to_name) = 'name'; my($subject) = 'Test'; my($body) = "Test Line One.\nTest Line Two.\n"; my $server = 'smtp.server.ex'; # SMTP SERVER my $port = 587; # my $timeout = 10; my $sock = IO::Socket::INET->new( PeerAddr => $server, PeerPort => $port, Proto => 'tcp', Timeout => $timeout, ); unless ( $sock ) { die"ERR - Could not connect socket to $server on port $port"; } if ( my $server = <$sock>) { print "Got Handshake: $server"; dialog( $sock, "EHLO local $cr$lf"); dialog( $sock, "AUTH LOGIN $cr$lf"); dialog( $sock, encode_base64($username)); dialog( $sock, encode_base64($password)); dialog( $sock, "MAIL FROM: <$from>$cr$lf"); dialog( $sock, "RCPT TO: <$to>$cr$lf"); dialog( $sock, "DATA $cr$lf"); dialog( $sock, "To: $to_name<$to>\r\nMIME-Version: 1.0\r\nContent-Ty +pe: text/plain; charset=utf-8\n$cr$lf"); dialog( $sock, "From: $from_name<$from>$cr$lf"); dialog( $sock, "Subject: $subject $cr$lf\r\n"); dialog( $sock, "$body $cr$lf"); dialog( $sock, ".$cr$lf"); dialog( $sock, "QUIT $cr$lf"); } else { die "No handshake sent from SMTP server\n" } sub dialog { my ( $sock, $send ) = @_; print $sock $send; print "Sent: $send"; my $receive = <$sock>; die "Got no response to $send" unless $receive; print "Recv: $receive"; }

In reply to Re^2: help on socket to smtp on TLS/SSL by beanscake
in thread help on socket to smtp on TLS/SSL by beanscake

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.