Changeset 1153 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Log.pm
- Timestamp:
- Jan 12, 2011, 2:42:12 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Log.pm
r1148 r1153 227 227 # mails the summary to $to 228 228 sub mailSummary { 229 require Mail::Sendmail; 230 my $self = shift; 231 my $to = shift || ""; 232 233 if ($to eq "") { 234 pb_log(0,"Please give a To: address\n"); 235 return; 236 } 237 my %mail = ( 238 To => $to, 239 From => "pb\@localhost", 240 Message => $self->summary() 241 ); 242 if (! sendmail(%mail)) { 243 if (defined $Mail::Sendmail::error) { 244 return $Mail::Sendmail::error; 245 } else { 246 return "Unkown error"; 247 } 248 } 249 pb_log(0,"Mail send to ". $to ."\n"); 229 eval 230 { 231 require Mail::Sendmail; 232 Mail::Sendmail->import(); 233 }; 234 if ($@) { 235 # Mail::Sendmail not found not sending mail ! 236 pb_log(0,"No Mail::Sendmail module found so not sending any mail !\n"); 237 } else { 238 my $self = shift; 239 my $to = shift || ""; 240 241 if ($to eq "") { 242 pb_log(0,"Please give a To: address\n"); 243 return; 244 } 245 my %mail = ( 246 To => $to, 247 From => "pb\@localhost", 248 Message => $self->summary() 249 ); 250 if (! sendmail(%mail)) { 251 if (defined $Mail::Sendmail::error) { 252 return $Mail::Sendmail::error; 253 } else { 254 return "Unkown error"; 255 } 256 } 257 pb_log(0,"Mail send to ". $to ."\n"); 258 } 250 259 } 251 260
Note:
See TracChangeset
for help on using the changeset viewer.