你如何使用email-> attach功能?
我无法想象发生了什么,当我把电子邮件的代码 - >附加消息后,空白(邮件正文)并没有附加.
如果我删除该代码行,一切都恢复正常..
谢谢
我的控制器(sendmail.php)
<?php
class Sendmail extends Controller {
function __construct() {
parent::Controller();
$this->load->library('email');
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('validation');
}
function index() {
$info = array (
'nome' => $this->input->post('nome'),
'mail' => $this->input->post('email'),
'motivo' => $this->input->post('motivo'),
'mensagem' => $this->input->post('mensagem'),
'anexo' => $this->input->post('upload'),
);
$this->load->library('email');
$this->email->set_newline('\r\n');
$this->email->clear();
$this->email->from($info['mail'], $info['nome']);
$this->email->to('example@mai.com');
/* $this->email->cc(''); # não é preciso */
$this->email->subject($info['motivo']);
$this->email->message($info['mensagem']);
$this->email->attach($info['anexo']);
if ($this->email->send() ) {
echo 'sent';
}
else {
$this->load->view('formulario');
# show_error( $this->email->print_debugger() );
}
}
}
?> …Run Code Online (Sandbox Code Playgroud) 我从DBIx :: Class开始,我有一个想要在DBIx :: Class中的子选择,但我感到困惑,无法构建代码.
我的MySQL选择是这个:
Select name from tblCategory where id = (
Select id from tblCategory where id = (
Select id from tblRadio where name = "RFM"
)
);
Run Code Online (Sandbox Code Playgroud)
我读到DBIx :: Class不支持subselect; 真的吗?如果是这样,你在这样的情况下做了什么?
我有一个小调查,但当我提交它说msg为空,我不知道我的错误在哪里.
如果你能帮助我,我可以帮助我.
谢谢
我的表单与Jquery和Ajax函数
<!DOCTYPE HTML>
<hmtl lang="pt-PT">
<head>
<title>Formulário</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
</head>
<body>
<hr />
<h3>Formulario</h3>
<script type="text/javascript" charset="utf-8">
$(function () {
$('#submiter').click( function() {
$.ajax({
type: "POST",
url: 'validar.php',
dataType: 'json',
success: function(msg) {
alert('Mensagem '+ msg.mensagem);
},
error : function () {
alert('Ocorreu um erro');
}
});
});
});
</script>
<form id="formulario" action="" method="post" accept-charset="utf-8">
<p>Pergunta 1</p>
<label for="pergunta1">sim</label><input type="radio" id="p1" name="pergunta1" value="1" /><br />
<label for="pergunta1">não</label><input type="radio" id="p1" name="pergunta1" value="0" />
<br />
<p>Pergunta 2</p> …Run Code Online (Sandbox Code Playgroud)