Comments (17)
Other needed option . use and manage mail template ( html and text )
from pi.
Implemented in commit 369a3f3
from pi.
I will test it in contact module. Thanks
from pi.
In Mail service -> message function, setTo ( or addTo ) method missing. And it good if add $message->setEncoding($charset);
from pi.
The service->message() returns a Zend\Message object and it already has the setTo/setEncoding methods.
from pi.
I am sorry, I use this method and set other options after return object
thanks
from pi.
Are we okay to close the issue? @voltan @MarcoXoops
from pi.
In localhost ( fedora : php 5.4.14 mysql 5.5.30 apache 2.4 But I am not sure my system mail service work will or not )I have problem whit : mimeMessage function, this part :
$part = function ($content) use ($this)
{
if (is_string($content)) {
$content = new Mime\Part($content);
}
if (is_array($content)) {
list($data, $type) = $content;
$content = $this->mimePart($data, $type);
}
return $content;
};
White screen whiteout error. But I don't check on live server .I will check tomorrow
from pi.
I guess it is caused by using _$this_ directly in anonymous function.
from pi.
For test I changed
public function mimeMessage($parts = array())
{
$message = new Mime\Message;
$part = function ($content) use ($this)
{
if (is_string($content)) {
$content = new Mime\Part($content);
}
if (is_array($content)) {
list($data, $type) = $content;
$content = $this->mimePart($data, $type);
}
return $content;
};
$parts = (array) $parts;
foreach ($parts as $content) {
$message->addPart($part($content));
}
return $message;
}
To
public function mimeMessage($parts = array())
{
$message = new Mime\Message;
$part = $this->mimeMessagePart($content);
$parts = (array) $parts;
foreach ($parts as $content) {
$message->addPart($part($content));
}
return $message;
}
function mimeMessagePart($content)
{
if (is_string($content)) {
$content = new Mime\Part($content);
}
if (is_array($content)) {
list($data, $type) = $content;
$content = $this->mimePart($data, $type);
}
return $content;
};
And it worked for me
from pi.
See updates in commit 77448fe
from pi.
Let me time to check
from pi.
Ok, I am also going to do test with my linode stack.
from pi.
hello,
about See var/config/service.mail.php
what is default value? phpmail?
there is no mail method setting anymore, can you explain how it works now?
from pi.
Default transport is sendmail through PHP mail function.
sendmail settings are configured in php.ini
Options for other transports can be set in service.mail.php, but only options defined by Zend/Mail are accepted.
from pi.
I test it, on server send mail system work will and without problem, Just it have problem in submitted mail, mail body set as text file and attached to the email, ( I send an example mail for you )
// Set subject and body
$subject = sprintf(__('Contact to %s , Subject : %s'), $values['department_title'], $values['subject']);
$body = $values['message'];
// Set message
$message = Pi::service('mail')->message($subject, $body, 'text/html');
$message->addTo($values['department_email'], $values['department_title']);
$message->setEncoding("UTF-8");
// Send mail
$transport = Pi::service('mail')->transport();
$transport->send($message);
I test whit template too, it use template very will , but again send body as attach file and I don't know how I can set information on template
from pi.
Mail service improved in commit 45d7947
BTW, I can not reproduce the attachment issue.
from pi.
Related Issues (20)
- Finish cron system HOT 1
- pi-engine/pi – Cross-Site Scripting (XSS) HOT 3
- Problem after remove end slash HOT 3
- Problem to remove end of slash HOT 1
- Page module > update error on latest code HOT 8
- setup > php 7.1 > ko HOT 1
- Save avatar not work HOT 1
- Error on register when captcha is off
- Upgrade to ZF3 HOT 2
- Update to Zend 2.4.13 HOT 1
- Login by social networks ( hybridauth ) HOT 7
- Reformat codes HOT 1
- New pdf system HOT 4
- Update to angularjs 5 HOT 1
- Move mobile number field to core table HOT 2
- User module instlation have problem on php 7.2
- Remove all vendor files from main repo and use composer to get them
- AbstractUser class has problem to detectuser rote
- Update DB for save IPV6
- Mining invite for improved security
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi.