Jump to content

erro ao enviar email


Recommended Posts


criei um sistema de neviar email simples para o meu site...


include "protection.php";


if($email_destino<>"" && $email_from<>"" && $assunto<>"" && $mensagem<>"")
	if(mail($email_destino, $assunto, $mensagem,"FROM: ".$email_from))
		$estado="<p><font color='green'>Email enviado com sucesso</font></p>";
		$estado="<p><font color='red'>Erro ao enviar email</font></p>";
	$estado="<p><font color='red'>Preencher todos os campos</font></p>";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Termofilm, Máquinas alimentares</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="shortcut icon" href="favicon.ico" />

<div id="top">
<img src="img/logo.png" alt="logo" />

<div id="menu">

<div id="efeito">

<div id="content" class="clearfix">
<h1>Area de Administração</h1>
<h1>Enviar e-mails</h1>

<div id="conteudo2" class="clearfix">

<img class= "1" src="img/embalagem.jpg" alt="logo"/>
<img class= "1" src="img/maquina.jpg" alt="logo" />

<h6><li><a href="home.php">Home</a></li></h6>

<h6>Enviar e-mails</h6>

	echo $estado;

    <form action="admin_send_mail.php" method="POST">
<h6>Destinatario:</h6><input type="text" name="email_destino"> <br>
<h6>De:</h6><input type="text" name="email_from"> <br>
<h6>Assunto:</h6><input type="text" name="assunto"> <br>
<h6>Mensagem:</h6><textarea rows="13" cols="50" name="mensagem"></textarea><br><br>
<input type="submit" name="enviar" value="Enviar">

<div id="bot" class="clearfix">

<div id="footer" class="clearfix">
<h6>©Termofilm, LDA</h6>


mas da-me um erro quando carrego no enviar:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\site termofilm\admin\admin_send_mail.php on line 15

ja estive a procura na net e pelo que percebi tenho de alterar a porta do localhost mas nao sei como isso se faz....

alguem me pode ajudar?


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.