I'm trying to send a email using the GoDaddy but the problem is my code isn't working.
Do I need to configure something on GoDaddy? The idea is I have a customer and they have a gmail account. The site has a form and the customer needs to receive all the submitted contact information to their gmail account.
I have no idea how to do it and have tried for three days with no success.
This is the code that I'm using to send the emails to the account:
/* Instanciando as Bibliotecas Responsaveis pelo PHPMailer */
require_once '../PHPMailer/class.phpmailer.php';
require_once '../PHPMailer/class.smtp.php';
/* Instanciando a Classe de Email */
$email = new PHPMailer();
/* Configurando o Email. */
$email->SMTPSecure = "ssl";
$email->IsSMTP();
$email->SMTPAuth = true;
$email->Host = "smtpout.secureserver.net";
$email->Port = 465;
$email->Username = "[email protected]";
$email->Password = "";
$email->IsHTML(true);
/* Configuracoes de quem Esta Mandando o Email. */
$email->SetFrom($_POST['txtEmail'], $_POST['txtName']);
$email->AddReplyTo($_POST['txtEmail'], $_POST['txtName']);
$email->From = "[email protected]";
$email->FromName = $_POST['txtName'];
$email->AddAddress('[email protected]');
$email->Subject = 'Contact Us Email';
$email->Body = 'Name : ' .$_POST['txtName']. '<br/>'.
'Email : ' .$_POST['txtEmail']. '<br/>'.
'Especialidade : ' .$_POST['txtEspecialidade'] . '<br/>'.
'Phone : ' .$_POST['txtTelefone']. '<br/>'.
'Message : ' .$_POST['txtComentario'];
/* Verificar se o Email foi Enviado com Sucesso */
if($email->Send()):
$Mensagem = 'Email Enviado com Sucesso';
else:
$Mensagem = 'Erro ao Enviar o Email '.$email->ErrorInfo;
endif;
/* Mostrar o Resultado. */
echo $Mensagem;
I'm sorry but it's in Portuguese. Thanks people.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…