# diff SendMail.pm.1.00 SendMail.pm.1.01
55c55
< $VERSION = "1.00";
---
> $VERSION = "1.01";
326c326
<     if ($value =~ /^[^\<]+\<([^\>\@]+\@\w+(\.\w+)+)\>/) {
---
>     if ($value =~ /^[^\<]+\<([^\>\@]+\@[\w\-]+(\.[\w\-]+)+)\>/) {
334c334
<     return $value if $value =~ /^[^\@]+\@\w+(\.\w+)+$/;
---
>     return $value if $value =~ /^[^\@]+\@[\w\-]+(\.[\w\-]+)+$/;
738a739,743
> =head1 CHANGES
>
> 1.00->1.01 Recipients with email address contains a "-" in the hostname,
> will be able to receive the email now.
>
756c761
< Version 1.00  13 June 1998
---
> Version 1.01  1 September 1998


#diff SendMail.pm.1.01 SendMail.pm.1.02
26a27
> #	$obj->receiveFromServer(\*SOCKET);
28a30
> #	$obj->sendToServer(\*SOCKET, $message);
55c57
< $VERSION = "1.01";
---
> $VERSION = "1.02";
413a416,440
> # METHOD:	$obj->receiveFromServer(\*SOCKET);
> #
> # DESCRIPTION:	This will receive the data replied from the server.
> #
> #===============================================================================
> sub receiveFromServer {
>     my($self) = shift;
>     my($socket) = shift;
>     my($reply);
> 
>     #
>     # We keep receiveing the data from the server until
>     # it waits for next command.
>     #
>     while ($reply = <$socket>) {
>       return $self->setError($reply) if $reply =~ /^5/;
>       print $reply if $self->{'debugmode'};
>       last if $reply =~ /^\d+ /;
>     }
> 
>     return 0;
> }
> 
> #===============================================================================
> #
440c467
<     my($iaddr, $paddr, $proto, $reply, $rcptlistRef, $currEmail) = undef;
---
>     my($iaddr, $paddr, $proto, $rcptlistRef, $currEmail) = undef;
480,494c507,513
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
<     print "HELO $LOCALHOST\n" if $self->{'debugmode'};
<     send(SOCK, "HELO $LOCALHOST\n", 0) || 
< 		return $self->setError("Fail to send \"HELO\" message: $!");
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
<     print "MAIL FROM: $self->{'sender'}\n" if $self->{'debugmode'};
<     send(SOCK, "MAIL FROM: $self->{'sender'}\n", 0) || 
< 	return $self->setError("Fail to send \"MAIL FROM:\" message: $!");
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
---
> 
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
>     return -1 if $self->sendToServer(\*SOCK, "HELO $LOCALHOST") != 0;
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
>     return -1 if $self->sendToServer(\*SOCK, "MAIL FROM: $self->{'sender'}") != 0;
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
>     my($currEmail);
496,501c515,516
<       print "RCPT TO: $currEmail\n" if $self->{'debugmode'};
<       send(SOCK, "RCPT TO: $currEmail\n", 0) || 
< 		return $self->setError("Fail to send \"RCPT TO:\" message: $!");
<       $reply = ;
<       return $self->setError($reply) if $reply =~ /^5/;
<       print $reply if $self->{'debugmode'};
---
>       return -1 if $self->sendToServer(\*SOCK, "RCPT TO: $currEmail") != 0;
>       return -1 if $self->receiveFromServer(\*SOCK) != 0;
503,520c518,523
<     print "DATA\n" if $self->{'debugmode'};
<     send(SOCK, "DATA\n", 0) || 
< 		return $self->setError("Fail to send \"DATA\" message: $!");
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
<     print "$self->{'maildata'}\n" if $self->{'debugmode'};
<     send(SOCK, "$self->{'maildata'}\n.\n", 0) || 
< 		return $self->setError("Fail to send data: $!");
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
<     print "QUIT\n" if $self->{'debugmode'};
<     send(SOCK, "QUIT\n", 0) || 
< 		return $self->setError("Fail to send \"QUIT\" message: $!");
<     $reply = ;
<     return $self->setError($reply) if $reply =~ /^5/;
<     print $reply if $self->{'debugmode'};
---
>     return -1 if $self->sendToServer(\*SOCK, "DATA") != 0;
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
>     return -1 if $self->sendToServer(\*SOCK, "$self->{'maildata'}\n.") != 0;
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
>     return -1 if $self->sendToServer(\*SOCK, "QUIT") != 0;
>     return -1 if $self->receiveFromServer(\*SOCK) != 0;
530a534,556
> # METHOD:	$obj->sendToServer(\*SOCKET, $message);
> #
> # DESCRIPTION:	This will send the message to the SMTP server.
> #
> #===============================================================================
> sub sendToServer {
>     my($self) = shift;
>     my($socket) = shift;
>     my($message) = shift;
> 
>     print "$message\n" if $self->{'debugmode'};
> 
>     #
>     # Sending data to the server.
>     #
>     send($socket, "$message\n", 0) || 
> 		return $self->setError("Fail to send $message: $!");
> 
>     return 0;
> }
> 
> #===============================================================================
> #
675c701
<   $headervalue		= "Perl SendMail Module 1.00";
---
>   $headervalue		= "Perl SendMail Module 1.02";
743a770,774
> 1.01->1.02 Module now not only expecting one line reply from the server, it
> can receive multiple lines until the server waiting for next command.
> (Thanks to "laurens van alphen"  http://craxx.com/
> who pointed this to me.)
> 
761c792
< Version 1.01 	1 September 1998
---
> Version 1.02 	18 September 1998


# diff SendMail.pm.1.02 SendMail.pm.1.03
57c57
< $VERSION = "1.03";
---
> $VERSION = "1.02";
512a513
>     my($currEmail);
700c701
<   $headervalue		= "Perl SendMail Module 1.03";
---
>   $headervalue		= "Perl SendMail Module 1.02";
774,776d774
< 1.02->1.03 Repeat declaration of "$currEmail" will give an error in NT
< system.
< 
794c792
< Version 1.03 	26 October 1998
---
> Version 1.02 	18 September 1998


# diff SendMail.pm.1.03 SendMail.pm.1.04
57c57
< $VERSION = "1.03";
---
> $VERSION = "1.04";
511c511
<     return -1 if $self->sendToServer(\*SOCK, "MAIL FROM: $self->{'sender'}") != 0;
---
>     return -1 if $self->sendToServer(\*SOCK, "MAIL FROM: <$self->{'sender'}>") != 0;
514c514
<       return -1 if $self->sendToServer(\*SOCK, "RCPT TO: $currEmail") != 0;
---
>       return -1 if $self->sendToServer(\*SOCK, "RCPT TO: <$currEmail>") != 0;
700c700
<   $headervalue		= "Perl SendMail Module 1.03";
---
>   $headervalue		= "Perl SendMail Module 1.04";
765a766
> 
771,772d771
< (Thanks to "laurens van alphen"  http://craxx.com/
< who pointed this to me.)
776a776,786
> 1.03->1.04 Email addresses are enclosed in < and > after "MAIL FROM" and
> "RCPT TO" commands.(RFC821) For Microsoft Exchange 4, email addresses
> not enclosed in < and > will get an error from the system.
> 
> =head1 CREDITS
> 
> 
> laurens van alphen  http://craxx.com/
> 
> Dag Řien 
> 
794c804
< Version 1.03 	26 October 1998
---
> Version 1.04 	4 November 1998


# diff SendMail.pm.1.04 SendMail.pm.1.05
57c57
< $VERSION = "1.04";
---
> $VERSION = "1.05";
327a328,332
>     if ($value =~ /^\<([^\>\@]+\@[\w\-]+(\.[\w\-]+)+)\>/) {
>       ($retvalue = $1) =~ tr/[A-Z]/[a-z]/;
>       return $retvalue;
>     }
> 
700c705
<   $headervalue		= "Perl SendMail Module 1.04";
---
>   $headervalue		= "Perl SendMail Module 1.05";
779a785,787
> 1.04->1.05 getEmailAddress() subroutine should accept email address
> in just "" format.
> 
786a795,796
> Juliano, Sylvia, CON, OASD(HA)/TMA 
> 
798c808
< Copyright (c) 1998 Simon Tneoh Chee-Boon. All rights reserved.
---
> Copyright (c) 1998,1999 Simon Tneoh Chee-Boon. All rights reserved.
804c814
< Version 1.04 	4 November 1998
---
> Version 1.05 	29 March 1999


# diff SendMail.pm.1.05 SendMail.pm.1.06
57c57
< $VERSION = "1.05";
---
> $VERSION = "1.06";
80c80,81
<     $self->{'smtpserver'}  = $smtpserver =~ /^\s*$/ ? "localhost" : $smtpserver;
---
>     $self->{'smtpserver'}  = ($smtpserver && $smtpserver =~ /^\s*$/)
> 	 ? "localhost" : $smtpserver;
85c86
<     $self->{'smtpport'}    = $smtpport =~ /^\d+$/ ? $smtpport : 25;
---
>     $self->{'smtpport'}    = ($smtpport && $smtpport =~ /^\d+$/) ? $smtpport : 25;
435c436
<     while ($reply = <$socket>) {
---
>     while ($socket && ($reply = <$socket>)) {
553c554
<     send($socket, "$message\n", 0) || 
---
>     send($socket, "$message\r\n", 0) || 
705c706
<   $headervalue		= "Perl SendMail Module 1.05";
---
>   $headervalue		= "Perl SendMail Module 1.06";
787a789,792
> 1.05->1.06 sendToServer() subroutine should send "\r\n" instead of
> "\n" only to the server. Sending only "\n" to the SMTP server, will
> cause errors for SMTP server on Windows platform.
> 
796a802,804
> Arjan Woerden
> 
> 
800c808
< http://www.tneoh.zoneit.com/perl/SendMail/SendMail.pm
---
> http://www.tneoh.zoneit.com/perl/SendMail/download/
808c816
< Copyright (c) 1998,1999 Simon Tneoh Chee-Boon. All rights reserved.
---
> Copyright (c) 1998,1999,2000 Simon Tneoh Chee-Boon. All rights reserved.
814c822
< Version 1.05 	29 March 1999
---
> Version 1.06 	30 January 2000


# diff SendMail.pm.1.06 SendMail.pm.1.07
57c57
< $VERSION = "1.06";
---
> $VERSION = "1.07";
706c706
<   $headervalue		= "Perl SendMail Module 1.06";
---
>   $headervalue		= "Perl SendMail Module 1.07";
792a793,795
> 1.06->1.07 Calling eof() to check the opened socket, else it will
> cause an error in ActivePerl5.6.
> 
796c799
< laurens van alphen  http://craxx.com/
---
> laurens van alphen 
798c801
< Dag Řien 
---
> Dag Řien 
800c803
< Juliano, Sylvia, CON, OASD(HA)/TMA 
---
> Juliano, Sylvia, CON, OASD(HA)/TMA 
803a807
> Jeff Graves
822c826
< Version 1.06 	30 January 2000
---
> Version 1.07 	25 July 2000


# diff SendMail.pm.1.07 SendMail.pm.1.08
57c57
< $VERSION = "1.07";
---
> $VERSION = "1.08";
525c525
<     return -1 if $self->sendToServer(\*SOCK, "$self->{'maildata'}\n.") != 0;
---
>     return -1 if $self->sendToServer(\*SOCK, "$self->{'maildata'}\r\n.") != 0;
706c706
<   $headervalue                = "Perl SendMail Module 1.07";
---
>   $headervalue                = "Perl SendMail Module 1.08";
795a796,798
> 1.07->1.08 After sending the maildata, supposed to be "\r\n" instead
> of just "\n".
>
826c829
< Version 1.07  25 July 2000
---
> Version 1.08  15 August 2000