bytemania Posted June 17, 2009 at 10:39 PM Report Share #273216 Posted June 17, 2009 at 10:39 PM Hi Tenho o seguinte problema Tenho o ubuntu 9.04 e queria enviar um mail vai php tenho instalado: PHP 5.2.6-3ubuntu4.1 Server version: Apache/2.2.11 (Ubuntu) send mail No ficheiro php.ini tenho a seguinte configuração sendmail_path = /usr/sbin/sendmail Ao executar nmap: nmap -sT localhost Tenho o seguinte output: 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 80/tcp open http 110/tcp open pop3 139/tcp open netbios-ssn 143/tcp open imap 445/tcp open microsoft-ds 587/tcp open submission 631/tcp open ipp ... Ao executar o a função php esta falha $to = "bytemania@gmail.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> ou seja dá como resultado Message delivery failed o log da /var/log/mail.log tail -f /var/log/mail.log Jun 17 23:36:02 ubuntu sm-mta[14592]: n5HMa2nO014591: to=<www-data@ubuntu>, ctladdr=<www-data@ubuntu> (33/33), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30842, dsn=2.0.0, stat=Sent Ficava muito grato se alguem me pudesse ajudar Também possuo um router na minha ligação a internet Link to comment Share on other sites More sharing options...
infopc Posted June 18, 2009 at 10:37 AM Report Share #273297 Posted June 18, 2009 at 10:37 AM Não consegues mostrar-nos o erro da função mail? hera mais util. O que não tem solução, solucionado esta... Link to comment Share on other sites More sharing options...
edsousa Posted June 18, 2009 at 12:01 PM Report Share #273325 Posted June 18, 2009 at 12:01 PM Boas Sérgio experimenta na linha de comandos mandar o mail $> mail -s "subject" endereço@email.com Corpo da mensagem e no fim terminas com Ctrl+D e vê se o email chega ao destino já agora, eu tenho um script php para emails que é assim: require_once 'Mail/mime.php'; require_once 'Mail.php'; $email = new Mail_mime(); $email->setFrom($from); $email->setSubject($subject); $email->setTxtBody($message); $encoded_to = $email->encodeRecipients($to); $body = $email->get(); $headers = $email->headers(); $sendmail = Mail::factory("mail"); $sendmail->send($encoded_to, $headers, $body); Tharis Fan ClubMay Tharis bless you Link to comment Share on other sites More sharing options...
bytemania Posted June 18, 2009 at 12:55 PM Author Report Share #273337 Posted June 18, 2009 at 12:55 PM Jun 18 13:54:47 ubuntu sm-msp-queue[8436]: My unqualified host name (ubuntu) unknown; sleeping for retry Jun 18 13:54:51 ubuntu sendmail[8320]: unable to qualify my own domain name (ubuntu) -- using short name Dá estes error Link to comment Share on other sites More sharing options...
edsousa Posted June 18, 2009 at 02:26 PM Report Share #273363 Posted June 18, 2009 at 02:26 PM deve te fazer falta instalar o exim4 em cima do sendmail vê este post, este user tinha o mesmo problema que tu http://ubuntuforums.org/showpost.php?p=3368753&postcount=15 Tharis Fan ClubMay Tharis bless you Link to comment Share on other sites More sharing options...
infopc Posted June 19, 2009 at 12:51 AM Report Share #273521 Posted June 19, 2009 at 12:51 AM tens que mudar o hostname da maquina e deve resolver O que não tem solução, solucionado esta... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now