@@ -308,8 +308,11 @@ |
||
| 308 | 308 | private function smtpPutCmd($cmd, $arg = "") |
| 309 | 309 | { |
| 310 | 310 | if ($arg != "") { |
| 311 | - if($cmd=="") $cmd = $arg; |
|
| 312 | - else $cmd = $cmd." ".$arg; |
|
| 311 | + if($cmd=="") { |
|
| 312 | + $cmd = $arg; |
|
| 313 | + } else { |
|
| 314 | + $cmd = $cmd." ".$arg; |
|
| 315 | + } |
|
| 313 | 316 | } |
| 314 | 317 | fputs($this->sock, $cmd."\r\n"); |
| 315 | 318 | $this->debug("> ".$cmd."\n"); |
@@ -167,10 +167,14 @@ discard block |
||
| 167 | 167 | public function addAttachments($attachments){ |
| 168 | 168 | if(is_array($attachments)){ |
| 169 | 169 | foreach ($attachments as $attachment){ |
| 170 | - if(file_exists($attachment)) $this->attachments[] = $attachment; |
|
| 170 | + if(file_exists($attachment)) { |
|
| 171 | + $this->attachments[] = $attachment; |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + } else{ |
|
| 175 | + if(file_exists($attachments)) { |
|
| 176 | + $this->attachments[] = $attachments; |
|
| 171 | 177 | } |
| 172 | - }else{ |
|
| 173 | - if(file_exists($attachments)) $this->attachments[] = $attachments; |
|
| 174 | 178 | } |
| 175 | 179 | return $this; |
| 176 | 180 | } |
@@ -183,7 +187,7 @@ discard block |
||
| 183 | 187 | public function addHeaders($headers){ |
| 184 | 188 | if(is_array($headers)){ |
| 185 | 189 | $this->headers = array_merge($this->headers,$headers); |
| 186 | - }else{ |
|
| 190 | + } else{ |
|
| 187 | 191 | $this->headers[] = $headers; |
| 188 | 192 | } |
| 189 | 193 | return $this; |
@@ -33,9 +33,9 @@ |
||
| 33 | 33 | $state = $email->sendmail( $mailtitle, $mailcontent, $mailtype); |
| 34 | 34 | echo "<div style='width:300px; margin:36px auto;'>"; |
| 35 | 35 | if($state==""){ |
| 36 | - echo "对不起,邮件发送失败!请检查邮箱填写是否有误。"; |
|
| 37 | - echo "<a href='index.html'>点此返回</a>"; |
|
| 38 | - exit(); |
|
| 36 | + echo "对不起,邮件发送失败!请检查邮箱填写是否有误。"; |
|
| 37 | + echo "<a href='index.html'>点此返回</a>"; |
|
| 38 | + exit(); |
|
| 39 | 39 | } |
| 40 | 40 | echo "恭喜!邮件发送成功!!"; |
| 41 | 41 | echo "<a href='index.html'>点此返回</a>"; |