public function contentcontrollerInit() { $location = ShopUserInfo::singleton()->getAddress(); $autocode = Page::config()->geocode_visitor_ip; if (!$location && $autocode || Controller::curr()->getRequest()->getVar('relocateuser')) { ShopUserInfo::singleton()->setAddress(new Address($this->findLocation())); } }
public function sendCMSMail($to, $from, $from_name, $subject, $body) { global $error; $mail = new PHPMailer(); // create a new object $mail->CharSet = 'utf-8'; //UTF-8 Kodierung festlegen $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->Host = Page::config()->host; $mail->Port = Page::config()->port; $mail->Username = Page::config()->username; $mail->Password = Page::config()->password; $mail->SetFrom($from, $from_name); $mail->Subject = $subject; $mail->IsHTML(true); $mail->Body = $body; $mail->AddAddress($to); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { $error = 'Message sent!'; return true; } }