我需要帮助通过ckeditor发送电子邮件并面临以下问题?
1)问题是我echo $message =$editor1;
时无法看到图像
当我在ckedit中插入图像时,如何在电子邮件中看到图像?
ckeditor在UserFilesAbsolutePath
2)如何在textarea name='email'
??
例如,使用逗号
的多个收据电子邮件demo@yahoo.com,test@yahoo.com,123@gmail.com & Sending TO All Select
//same like gmail,yahoo & hotmail
处理页面
此处发送电子邮件页面
if(isset($_POST['sendemail'])){
$email=$_POST['email'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$editor1=$_POST['editor1'];
$your_email = 'test@yahoo.com'; //CHANGE TO YOUR SETTINGS
$domain = $_SERVER["HTTP_HOST"]; //YOUR DOMAIN AND EXTENSION
$to = $email;
$subject = $subject;
echo $message =$editor1;
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: Testing Email<$your_email>\r\n" .
"X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, $headers);
//if(!empty($message)){
//header('Location:index.php');
//}
}
索引页
<form action="process.php" method="post">
To:
<textarea class="input_field" name="email" id="email"></textarea>
Subject:
<input type="text" name="subject" id="subject" />
Message:
<textarea class="ckeditor" name="editor1" id="editor1" ></textarea>
<script type="text/javascript">
var editor = CKEDITOR.replace( 'editor1', {
tabSpaces:10,
filebrowserBrowseUrl :'ckeditor/filemanager/browser/default/browser.html?Connector=http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/connector.php',
filebrowserImageBrowseUrl : 'ckeditor/filemanager/browser/default/browser.html?Type=Image&Connector=http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/connector.php',
filebrowserFlashBrowseUrl :'ckeditor/filemanager/browser/default/browser.html?Type=Flash&Connector=http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/connector.php',
filebrowserUploadUrl :'http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/upload.php?Type=File',
filebrowserImageUploadUrl : 'http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/upload.php?Type=Image',
filebrowserFlashUploadUrl : 'http://localhost/test/phpmultipleemails/ckeditor/filemanager/connectors/php/upload.php?Type=Flash',
filebrowserWindowWidth : '730',
filebrowserWindowHeight : '500'
});
CKEDITOR.instances["post-content"].on("instanceReady", InstanceReadyEvent);
function InstanceReadyEvent() {
this.document.on("keyup", function () {
$('#editform').trigger('change');
});
}
</script>
这里是我的UserFilesPath for Ckeditor Filemanager
$Config['UserFilesPath'] =
'http://localhost/test/phpmultipleemails/uploads/';
这里是我的UserFilesAbsolutePath for Ckeditor Filemanager
$Config['UserFilesAbsolutePath'] =
'D:\\xampp\\htdocs\\test\\phpmultipleemails\\uploads\\;
答案 0 :(得分:1)
Google使用代理来显示图片。由于您的本地主机无法公开访问,因此Google无法找到您通过邮件发送的图像。
查看Gmail中src
标记的img
属性。它是这样的:https://ci4.googleusercontent.com/proxy/HMqMF9fRFZZi(...)而不是localhost URL。
但是,您可以使用ngrok等隧道服务来公开访问本地主机:https://ngrok.com/usage