[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Email tag: different behaviour sendmail and Net::SMTP


Ton Verhagen <suppressed> wrote:
> I am experiencing problems with the email tag in IC5.5.0 (cvs)
> 
> It does all the tricks when I use sendmail as the mail agent,
> however, using Net::SMTP the following code does not send
> email. Running the code including the test=1 option shows
> a properly formatted email message imho.
> 
> Please note:
> Sending email without an attachment works fine using Net::SMTP
> 
> [email
>          to="suppressed"
>          from="suppressed"
>          subject="File: bg.gif"
>          attach='images/bg.gif'
> ]Here is your file.[/email]
> 
> What could be wrong?
> 
It appears that if you use "attach" then [email] calls [email-raw] for
some reason.  [email-raw] doesn't appear to have been coded to make use
of Net::SMTP.

A quick and dirty fix might look a little bit like this:

--- code/UserTag/email.tag      8 Nov 2005 18:14:42 -0000       1.12
+++ code/UserTag/email.tag      31 Jan 2007 16:11:25 -0000
@@ -159,7 +159,14 @@
                        return $body;
                }
                else {
-                       return $Tag->email_raw({}, $body);
+                       $body =~ s/^(.*)\n\n//s;
+
+                       foreach (split("\n",$1)) {
+                               next unless $_;
+                               next if $_ =~ /(?:Date|To|From|Subject)/i;
+
+                               push(@extra,$_);
+                       }
                }
        }

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    suppressed
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.