Announcement

Collapse
No announcement yet.

SendMail Patch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SendMail Patch

    Does Norman's excellent SendMail patch (http://www.drillpine.biz/sellerdecks...eadoOfSMTP.txt) still work in v18/Swift and does the patching replace lines following:

    Code:
    sub SendMail
    {
    #? ACTINIC::ASSERT($#_ >= 4, "Invalid argument count in SendMail ($#_)", __LINE__, __FILE__);
    
    #
    # !!!!!! This is a function commonly used by many utilities. Any changes to its interface will
    # !!!!!! need to be verified with the various utility scripts.
    #
    
    if ($#_ < 4)
    {
    return($::FAILURE, GetPhrase(-1, 12, 'Actinic::SendMail'), 0, 0);
    }
    
    my ($sSmtpServer, $sEmailAddress, $sLocalError, $sSubjectText, $sMessageText, $sMessageHTML, $sBoundary, $sReturnAddress);
    ($sSmtpServer, $sEmailAddress, $sSubjectText, $sMessageText, $sMessageHTML, $sReturnAddress) = @_;
    #
    # Check message content for bare LFs and repair if there are some
    #
    
    $sMessageText =~ s/\r\n/\n/g; # CRLF -> LF
    $sMessageText =~ s/\r/\n/g; # remaining CR -> LF
    $sMessageText =~ s/\n/\r\n/g; # all LF -> CRLF
    # and check the HTML content as well
    $sMessageHTML =~ s/\r\n/\n/g; # CRLF -> LF
    $sMessageHTML =~ s/\r/\n/g; # remaining CR -> LF
    $sMessageHTML =~ s/\n/\r\n/g; # all LF -> CRLF
    #
    # Check the return address
    #
    if (!$sReturnAddress) # if no return address defined
    {
    $sReturnAddress = $sEmailAddress; # use the destination email address
    }
    
    # (V11) use systems sendmail program
    my $mailer = Mail::Mailer->new();
    $mailer->open({ From => $sReturnAddress,
    To => $sEmailAddress,
    Subject => $sSubjectText,
    })
    or die "Can't open: $!\n";
    
    print $mailer $sMessageText;
    $mailer->close();
    
    return($::SUCCESS, '', 0, 0);
    }
    And does this work for network testing?

    Thank you
    Last edited by graphicz; 25-Mar-2024, 03:13 PM. Reason: My ptach script was incorrect - replace all instances of sendrichmail with sendmail in the patched sequence
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    It does appear to work in v18 replacing as above...
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment

    Working...
    X