我正在尝试使用带附件的PEAR邮件包发送带有PHP的电子邮件.电子邮件成功发送了我从互联网上获得的代码.但是,附件不会被发送或附加.我哪里出错了,下面是我的代码.
<?php
require_once "Mail.php";
require_once "Mail/mime.php";
$from = "<my.name@company.com>";
$to = "<myname@gmail.com>";
$subject = "Testing email from PHP with attachment";
$body = "Testing email from PHP with attachment";
$file = "invoices/PRINV7_3.pdf";
$host = "host";
$port = "25";
$username = "username";
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$mime = new Mail_mime();
if ($mime->addAttachment($file,'application/pdf')){
echo "attached successfully! </br>";
} else {
echo "Nope, failed to attache!! </br>";
}
$smtp = Mail::factory('smtp',
array ('host' …Run Code Online (Sandbox Code Playgroud) 我想为我的日历显示15的slotMinutes.但它不起作用.它适用于这个小提琴
$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
defaultView: 'agendaWeek',
editable: true,
slotMinutes: 15,
selectable: true,
//header and other values
select: function(start, end, allDay) {
endtime = $.fullCalendar.formatDate(end,'h:mm tt');
starttime = $.fullCalendar.formatDate(start,'ddd, MMM d, h:mm tt');
var mywhen = starttime + ' - ' + endtime;
$('#createEventModal #apptStartTime').val(start);
$('#createEventModal #apptEndTime').val(end);
$('#createEventModal #apptAllDay').val(allDay);
$('#createEventModal #when').text(mywhen);
$('#createEventModal').modal('show');
}
});
Run Code Online (Sandbox Code Playgroud)
要访问小提琴,请单击http://jsfiddle.net/mccannf/AzmJv/16/ ...但是,它不适用于我的,我做错了什么?