Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net::SMTP

Status
Not open for further replies.

EchoCola

Programmer
Apr 13, 2004
48
US
Hello, I just wanted to know if there was a way to disable the displaying of the transcation when I execute an SMTP session using NET:SMTP module. I tried to turn the debug option to 0, but doesn't really do much, also tried to look for print statement within the .pm but didn't see anything that could be disabled.


Thanks guys
 
This might do it for you by closing STDOUT before you execute the code that prints to the console. I just adapted this from the code in the thread here -
Code:
closeSTDOUT();
print "STDOUT closed"; #this line shouldn't print to console
openSTDOUT();
print "STDOUT open"; #this should print to console

sub closeSTDOUT {
  open (OLDSTDOUT, ">&STDOUT") or die "Couldn't dup STDOUT: $!";
  close(STDOUT);
}

sub openSTDOUT {
  open (STDOUT, ">&OLDSTDOUT") or die "Can't restore STDOUT: $!";
  close OLDSTDOUT;
}
 
It worked, just had to close STDERR. Thanks for the idea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top