01.<?php
02.include_once ("Swift.php");
03.include_once ("Swift/Connection/SMTP.php");
04.include_once ("Swift/Authenticator/LOGIN.php");
05.
06.$receive_mail="demo_receive@gmail.com";
07.
08.$smtp = new Swift_Connection_SMTP('smtp.sina.com', 25);
09.
10.$smtp->setUsername('demo_send@sina.com');
11.
12.$smtp->setPassword('1qaz2wsx');
13.
14.if(stripos($receive_mail,"@gmail.com")!==false){
15.$smtp->attachAuthenticator(new Swift_Authenticator_LOGIN());
16.}
17.$swift = new Swift($smtp);
18.
19.$title="您收到一封新的求职简历,应聘php程序员的职位";
20.
21.$content="管理员,您好!您收到一封新的求职简历,应聘php程序员的职位......<br/>";
22.$message = new Swift_Message($title, $content, 'text/html', 'base64');
23.echo ($swift->send( $message, $receive_mail, new Swift_Address('demo_send@sina.com','demo_sender')))?'成功':'失败';
24.?>