diff --git a/smtp.transport.inc b/smtp.transport.inc
index cdd27de..dfecfb0 100644
--- a/smtp.transport.inc
+++ b/smtp.transport.inc
@@ -141,7 +141,7 @@ class SMTP {
                            "errno" => $errno,
                            "errstr" => $errstr);
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @errstr (@errno)", array("@error" => $this->error["error"], "@errstr" => $errstr, "@errno" => $errno)));
       }
       return FALSE;
     }
@@ -155,7 +155,7 @@ class SMTP {
     $announce = $this->get_lines();
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @announce", array("@announce" => $announce)));
     }
 
     return TRUE;
@@ -184,7 +184,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 220) {
@@ -193,7 +193,7 @@ class SMTP {
                "smtp_code" => $code,
                "smtp_msg"  => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -225,7 +225,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -242,7 +242,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -259,7 +259,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -278,7 +278,7 @@ class SMTP {
       if ($sock_status["eof"]) {
         // the socket is valid but we are not connected
         if ($this->do_debug >= 1) {
-            echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
+          drupal_set_message(t("SMTP -> NOTICE: EOF caught while checking if connected"));
         }
         $this->Close();
         return FALSE;
@@ -343,7 +343,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 354) {
@@ -352,7 +352,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -437,7 +437,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250) {
@@ -446,7 +446,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -502,7 +502,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250) {
@@ -511,7 +511,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -551,7 +551,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250) {
@@ -560,7 +560,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -594,7 +594,7 @@ class SMTP {
     $byemsg = $this->get_lines();
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @byemsg", array("@rply" => $byemsg)));
     }
 
     $rval = TRUE;
@@ -608,7 +608,7 @@ class SMTP {
                  "smtp_rply" => substr($byemsg, 4));
       $rval = FALSE;
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
     }
 
@@ -646,7 +646,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250 && $code != 251) {
@@ -655,7 +655,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -689,7 +689,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250) {
@@ -698,7 +698,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -736,7 +736,7 @@ class SMTP {
     $code = substr($rply, 0, 3);
 
     if ($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
     }
 
     if ($code != 250) {
@@ -745,7 +745,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply, 4));
       if ($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
       }
       return FALSE;
     }
@@ -768,7 +768,7 @@ class SMTP {
   public function Turn() {
     $this->error = array("error" => "This method, TURN, of the SMTP is not implemented");
     if ($this->do_debug >= 1) {
-      echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
+      drupal_set_message(t("SMTP -> NOTICE: @error", array("@error" => $this->error["error"])));
     }
     return FALSE;
   }
@@ -799,12 +799,12 @@ class SMTP {
     $data = "";
     while ($str = @fgets($this->smtp_conn, 515)) {
       if ($this->do_debug >= 4) {
-        echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
-        echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array("@data" => $data)));
+        drupal_set_message(t("SMTP -> get_lines(): \$str is \"@str\"", array("@str" => $str)));
       }
       $data .= $str;
       if ($this->do_debug >= 4) {
-        echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
+        drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array("@data" => $data)));
       }
       // if 4th character is a space, we are done reading, break the loop
       if (substr($str, 3, 1) == " ") {
