我需要生成包含变音字符的德语电子邮件.在电子邮件本身,这种方法很完美,但不是电子邮件的主题.我尝试了许多不同的变音字母,除了ü外,它们似乎都有效.我也尝试过不同的邮件库(HTMLMimeMail和PHPMailer),但它们都失败了:
$mail = new htmlMimeMail();
$mail->setTextEncoding("base64");
$mail->setHTMLEncoding("base64");
$mail->setTextCharset("UTF-8");
$mail->setHTMLCharset("UTF-8");
$mail->setHeadCharset("UTF-8");
$mail->setSMTPParams(mailinglist_smtp_host,mailinglist_smtp_port);
$mail->setHtml("test");
$mail->setFrom("test@test.nl");
$mail->setSubject("The ï, ö, ë, ä, and é work, but when adding the ü it doesn't");
$recipients[] = "me@myhost.nl";
$mail->send($recipients);
Run Code Online (Sandbox Code Playgroud)
&
$mail = new PHPMailer();
$mail->IsMail();
$mail->FromName = 'test';
$mail->From = 'test@test.nl';
$mail->AddAddress("me@myhost.nl");
$mail->Subject = "The ï, ö, ë, ä, and é work, but when adding the ü it doesn't";
$mail->Body = "test";
$mail->Send();
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我找到这个问题的来源和解决方案吗?
我正在使用SVN precommit钩子来验证我的代码标准(PSR2),然后才能提交.只需一个例外就可以完美地工作.我的单元测试(PHPUnit)文件存在我的所有静态单元测试函数的引导类,但也启用了引导类定义之上的错误消息.
PSR2标准在尝试提交时会发出警告,因为您不能在包含类定义的文件中包含不在类或函数中的代码.
有没有人有办法在我的代码中除去这个错误或者让我的代码有效的方法(没有把代码放在bootstrap类的每个静态函数中启用我的错误消息)?
这是文件:
<?php
namespace AlbumTest;
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\Service\ServiceManagerConfig;
use Zend\ServiceManager\ServiceManager;
use Zend\Stdlib\ArrayUtils;
use RuntimeException;
error_reporting(E_ALL | E_STRICT);
chdir(__DIR__);
class Bootstrap
{
protected static $serviceManager;
protected static $config;
protected static $bootstrap;
public static function init()
{
// Load the user-defined test configuration file, if it exists; otherwise, load
if (is_readable(__DIR__ . '/TestConfig.php')) {
$testConfig = include __DIR__ . '/TestConfig.php';
} else {
$testConfig = include __DIR__ . '/TestConfig.php.dist';
}
$zf2ModulePaths = array();
if (isset($testConfig['module_listener_options']['module_paths'])) {
$modulePaths = …Run Code Online (Sandbox Code Playgroud)