Problems, need help? Have a tip or advice? Post it here.
14 posts Page 1 of 2
Hi guys,

First, congratulations! Couch CMS is awesome! I'm waiting for a system like this for a long time!

Second, sorry for my english, i'm from Brazil ;)

So, for some unknown reason my Couch CMS its not sending emails. I have already configured config.php with my email and already tried the "use_alternative_mta" but nothing..

The file is this: http://ciadasaguas.com.br/zila/contato.php

The CSS is not finished the alerts is out of position.

Can you help me?
Hi,

Could you attach or PM me the actual template code of contato.php?

Thanks
Hi KK,

I will paste here ok?

Sorry, Its a litte messy

Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Contato' />

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zila Ghisolfi - História Política e Relações Internacionais</title>
<link rel="stylesheet" href="css/estilo.css">
</head>

<body>

<div id="topo">
  <div class="shadow-one">
  <div class="corner-a">
  </div>   
  <div class="corner-b">
  </div>
  <div class="shadow-two">
  <div class="shadow-three">
  <div class="shadow-four">
  <img src="lay/topo.jpg" width="888" height="196" />
  </div></div></div></div>
</div>


<div id="centro">
  <div class="shadow-one">
  <div class="corner-a">
  </div>   
  <div class="corner-b">
  </div>
  <div class="shadow-two">
  <div class="shadow-three">
  <div class="shadow-four">
    <div id="miolo">
      <div id="menu">
      <img src="lay/menu.jpg" width="836" height="40" border="0" usemap="#Map" />
      <map name="Map" id="Map"><area shape="rect" coords="69,7,140,34" href="index.html" /><area shape="rect" coords="680,6,765,34" href="contato.html" /><area shape="rect" coords="467,7,634,34" href="leituras.html" /><area shape="rect" coords="317,7,415,35" href="publicacoes.html" /><area shape="rect" coords="187,7,272,35" href="biografia.html" />
      </map>
      </div>
      <div id="conteudo">
        <h1>Contato</h1>
        <hr />
<Br />
Entre em contato através de uma das redes abaixo:
<br />
<div id="icones_contato">
<img src="lay/lattes.gif" align="absmiddle" /> &nbsp;<a href="#">Plataforma Lattes</a>
&nbsp;&nbsp;&nbsp;
<img src="lay/facebook.gif"  align="absmiddle"  /> &nbsp;<a href="#">Facebook</a>
&nbsp;&nbsp;&nbsp;
<img src="lay/twitter.gif"  align="absmiddle"  /> &nbsp;<a href="#">Twitter</a>
&nbsp;&nbsp;&nbsp;
<img src="lay/email.gif" width="27" height="29"  align="absmiddle"  /> &nbsp; <a href="mailto:zilaghisolfi@gmail.com">E-mail: zilaghisolfi@gmail.com</a>
</div>
<Br />
Você pode também enviar-me um e-mail através do formulário abaixo.
<br />
<br />

<cms:form action='' method='post' id='contact_form'>
<div id="formcol1">
<strong>Nome:</strong>
<br />
<cms:input type='text' name='name' id='name' required='1' />
<br />
                  <cms:if k_error_name>
                     <p id='name_error' class='error' style="display:block">Insert a Name</p>
                  </cms:if>
<strong>E-mail:</strong>
<br />
<cms:input type='text' name='email' id='email' required='1' validator='email' />
<br />
                  <cms:if k_error_email>
                     <p id='email_error' class='error' style="display:block">Enter a valid email address</p>
                  </cms:if>
<strong>Assunto:</strong>
<br />
<cms:input type='text' name='subject' id='subject' required='1' />
<br />
                  <cms:if k_error_subject>
                     <p id='subject_error' class='error' style="display:block">Enter a message subject</p>
                  </cms:if>
</div>
<div id="formcol2">
<strong>Mensagem:</strong>
<br />
                  <cms:if k_error_message>
                     <p id='message_error' class='error' style="display:block">Enter a message</p>
                  </cms:if>
<cms:input type='textarea' name='message' id='message' required='1' rows="30" cols="30"></cms:input>
<br />
               <cms:if k_success >   
                  <p id='mail_success' class='success' style="display:block">Thank you. I'll get back to you as soon as possible.</p>
                  
                  <cms:send_mail from=k_email_from to=k_email_to subject='Feedback from your site'>
                     The following is an email sent by a visitor to your site:
                     <cms:show k_success />
                  </cms:send_mail>
               </cms:if>

               <div id="button">
               <input type='submit' id='send_message' class="button" value='Submit' />
               </div>
</div>
</cms:form>


<Br />
      </div>
      <div id="footer">
      <img src="lay/footer.jpg" width="836" height="40" />
      </div>
    </div>
  </div></div></div></div>
</div>


</body>
</html>

<?php COUCH::invoke(); ?>
Hi,

Nothing wrong with the code. It is perfectly ok and is sending out the email on my machine.

So now we need to find out if at all mail can be send from your server using PHP 'mail' function (that is used internally by Couch).
Please create a plain php file (name it anything - maybe 'test-mail.php' and paste in the following code in it -
Code: Select all
<?php
$to  = 'to@example.com';
$subject = 'Test';
$message = 'hello';
$headers = 'From: from@example.com';

$rs = mail($to, $subject, $message, $headers);
echo '<h3>Email sent: ' . $rs . '</h3>';
?>

Please fill in your real email 'from' and 'to' addresses in the code and try executing this file.
If email is send, the script will print out '1' else '0'.

If you do not receive the email, you'll have to contact your web host.

However, if the code above works and you get the email, next troubleshoot couch send_mail tag -
add the 'debug' parameter to the 'send_mail' tag so that it becomes -
Code: Select all
<cms:send_mail from=k_email_from to=k_email_to subject='Feedback from your site' debug='1'>
    The following is an email sent by a visitor to your site:
    <cms:show k_success />
</cms:send_mail>

Try filling the form and submitting it. You should now find a text file named 'log.txt' in your site's root folder (check it by your FTP client or any other way you use to explore your site).
It will contain details of whether email was send or not.

Please let me know.
KK,

I made the test file and the answer is:
Email sent: 1

But nothing comes to my email..

Im not understanding.. I have a magento store in this host, and magento uses mail function too.. And it works ;(
Hi,
OK so I take it that after getting the 'Email sent: 1' you actually also got the email delivered to you.

So now have you used the 'debug' parameter in the 'send_mail' tag and taken a look at the output in the log file?
Please look carefully at the email addresses that gets output. Are they OK?

Thanks
Hey KK,

The log file contains:

Code: Select all
=======================[2011-02-20 21:29:07]=======================
From: pvfreitas@gmail.com
To: pvfreitas@gmail.com
Subject: Feedback from your site
Message:
                     The following is an email sent by a visitor to your site:
                     name: Test
email: email@email.com
subject: aojndasjon
message: sdafdfsadfajbnasjiodbasdoijasbnd oasodasodbbasnd
                  

Delivery Success


But any email comes to my inbox..
Hi,

That is intriguing.
Could you possibly send me (PM) your FTP and Couch credentials?
I think I'll need to take a closer look into the issue.

Thanks
KK,

I was testing this website in a temporary host (UOLhost, a brazilian company). I moved to the definive host (Siteground.com) and now works :D

But, I have other problem now ;p

In the old host, all characters looks ok. But in this host, I'm apparently having a problem with the charset.. Some characters like "ç" and "õ" do not appears.. just a "?".

I tried to create a .htaccess file in root with "AddDefaultCharset utf-8" but nothing changes.. what can I do?

Thanks!
Glad the email finally arrived :)

Coming to the charset problem, could you let me know how you migrated the data between the servers? Did you take SQL dump and apply it or created the site from scratch and entered the data manually?
Does the problem appear on fresh data that you store on the new server too?
14 posts Page 1 of 2