Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Mailer extends PHPMailer
- {
- public function __construct($sender = array(), $isHTML = true)
- {
- $this->Mailer = 'smtp';
- if($this->Mailer == 'smtp')
- {
- $this->Host = "smtp.gmail.com";
- $this->Port = 587;
- $this->SMTPSecure = "tls";
- $this->SMTPAuth = true;
- $this->Password = "jelszo";
- }
- if (!is_array($sender) || empty($sender))
- {
- // felado beallitasa vmire ha nincs megadva
- }
- else
- {
- list($key, $val) = $sender;
- $this->Sender = $key;
- $this->From = $key;
- $this->FromName = $val;
- }
- $this->isHTML($isHTML);
- }
- }
- $mail = new Mailer(array('felado email', 'felado neve'));
- $mail->AddAddress(
- 'cimzett email',
- 'cimzett neve'
- );
- $mail->Subject = 'Targy';
- $mail->Body = 'uzenet, HTML tamogatassal';
- if ($mail->Send())
- {
- // minden ok
- }
- else
- {
- // baj van
- }
Advertisement
Add Comment
Please, Sign In to add comment