zend-mail

How can I make email template in Zend Framework?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 00:09:05
问题 I want to make email templates in Zend Framework. For example, <html> <body> Dear {$username$},<br> This is a invitation email sent by your {$friend$}.<br> Regards,<br> Admin </body> </html> I want to make this file, get it in Zend framework, set those parameters (username, friend) and then send the email. How can I do that? Does Zend support this? 回答1: Hi this is realy common. Create an view script like : /views/emails/template.phtml <body> <?php echo $this->name; ?> <h1>Welcome</h1> <?php

zend framework zend_mail function error included code

六眼飞鱼酱① 提交于 2019-12-02 19:52:37
问题 I get the following error when I use zend_mail() function the following code : Error on Page : An error occurred Application error My code for sending mail using Zend_Mail() which I included in indexcontroller.php: public function passchangeAction() { $mail = new Zend_Mail(); $mail->addTo('maymail@gmail.com', 'my name') ->setFrom('mymail@gmail.com', 'my name') ->setSubject('My Subject') ->setBodyText('Email Body') ->send(); } There is no code present in passchange.phtml 来源: https:/

How can I make email template in Zend Framework?

丶灬走出姿态 提交于 2019-12-02 13:53:16
I want to make email templates in Zend Framework. For example, <html> <body> Dear {$username$},<br> This is a invitation email sent by your {$friend$}.<br> Regards,<br> Admin </body> </html> I want to make this file, get it in Zend framework, set those parameters (username, friend) and then send the email. How can I do that? Does Zend support this? Hi this is realy common. Create an view script like : /views/emails/template.phtml <body> <?php echo $this->name; ?> <h1>Welcome</h1> <?php echo $this->mysite; ?> </body> and when creating the email : // create view object $html = new Zend_View();

zend framework zend_mail function error included code

不问归期 提交于 2019-12-02 08:51:49
I get the following error when I use zend_mail() function the following code : Error on Page : An error occurred Application error My code for sending mail using Zend_Mail() which I included in indexcontroller.php: public function passchangeAction() { $mail = new Zend_Mail(); $mail->addTo('maymail@gmail.com', 'my name') ->setFrom('mymail@gmail.com', 'my name') ->setSubject('My Subject') ->setBodyText('Email Body') ->send(); } There is no code present in passchange.phtml 来源: https://stackoverflow.com/questions/8508888/zend-framework-zend-mail-function-error-included-code

Send mail without blocking 'execution'

十年热恋 提交于 2019-12-01 11:15:58
I'm using Zend_Mail in a Zend Framework application to send an e-mail with the contents of a web-based contact form. The mailing itself works fine ( im using a Google Apps account ) but it can take fairly long to process ( ranging from a few seconds to nearly a minute ). My controler action would normally redirect the visitor after sending the mail, so I thought I might be able to redirect the visitor prior to calling $mail->send() and let the script continue in the 'background': So I tried the following: $mailView = clone $this->view; $mailView->assign('name', $form->getValue('name'));

how to avoid email header Received: from unknown and email going to spam

柔情痞子 提交于 2019-12-01 05:26:51
I try to send email from our server using php and Zend_Mail. I use smtp transport. This is confimation email of subscribing. But for some reason email that I send has strange headers and email goes to spam folder (I see them in gmail that receive letter): Message-Id: <50ee94f7.84fc440a.62dc.ffff9685SMTPIN_ADDED_MISSING@mx.google.com> Received: (qmail 10943 invoked from network); 10 Jan 2013 10:16:22 -0000 Received: from unknown (HELO searchboxindustries.com) (username@searchboxindustries.com@207.162.215.30) What does it mean list header "Recieved: from unknown"? Can it make email go to spam?

how to avoid email header Received: from unknown and email going to spam

我只是一个虾纸丫 提交于 2019-12-01 03:48:36
问题 I try to send email from our server using php and Zend_Mail. I use smtp transport. This is confimation email of subscribing. But for some reason email that I send has strange headers and email goes to spam folder (I see them in gmail that receive letter): Message-Id: <50ee94f7.84fc440a.62dc.ffff9685SMTPIN_ADDED_MISSING@mx.google.com> Received: (qmail 10943 invoked from network); 10 Jan 2013 10:16:22 -0000 Received: from unknown (HELO searchboxindustries.com) (username@searchboxindustries.com

Why doesn't this mail message decode correctly?

試著忘記壹切 提交于 2019-12-01 00:11:52
I have this code. It's from the Zend Reading Mail example. $message = $mail->getMessage(1); // output first text/plain part $foundPart = null; foreach (new RecursiveIteratorIterator($mail->getMessage(1)) as $part) { try { if (strtok($part->contentType, ';') == 'text/plain') { $foundPart = $part; break; } } catch (Zend_Mail_Exception $e) { // ignore } } if (!$foundPart) { echo 'no plain text part found'; } else { echo $foundPart->getContent(); } What I can get is the message, that works fine. But trying to decode the message into something readable does not work. I have tried Zend_Mime, imap

Problem when sending mail with Zend Mail?

…衆ロ難τιáo~ 提交于 2019-11-30 11:37:59
I'm trying to send an e-mail with ZendMail ( this simple script sums it up ) <?php require_once 'Zend/Mail.php'; $mail = new Zend_Mail(); $mail->setBodyText('My Nice Test Text'); $mail->setBodyHtml('My Nice Test Text'); $mail->setFrom('test@example.com', 'Mr Example'); $mail->addTo('contact@mypage.com', 'Mr Test'); $mail->setSubject('TestSubject'); $mail->send(); ?> However I get this stack trace: Fatal error: Uncaught exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /usr/share/php/libzend-framework-php/Zend/Mail/Transport/Sendmail.php:137 Stack trace: #0 /usr

Adding an PDF attachment when using Zend_Mail

心已入冬 提交于 2019-11-30 07:36:21
What is the right way to add an attachment when using Zend_Mail? I keep getting the following error when I try to open the attached pdf in the sent mail: "Cannot extract the embedded font 'BAAAAAA+ArialMT'. Some characters may not display or print correctly." The PDF shows only the table but no characters. This is very weird because the PDF opens corectly if i download it directly from the server or on my localhost. This is the code I used for sending the attachement: $html = $view->render('email/invoice.phtml'); $mail = new Zend_Mail("utf-8"); $file = PUBLIC_PATH . DS . 'data' . DS . $invoice