people. I'm fairly new to coding; I've been watching tutorials and reading about it for about two months. My motivation for learning it is to make a website for my cousin who so dearly wants one, but currently neither has the money to pay someone to do it for him, nor does he have the time or mindspace to learn it.
But, I do! So, here I am. I'm learning codes to make a website for him. I also believe it can help me on some of my projects but my real motivation is that.
I've been struggling with two aspects of e-mail forms -- One is this: [three call stack erros saying I didn't define the form names, I believe, although it seems to me that I did]
[removed some stuff]
EDIT
I'm currently using google smtp.gmail server, but to no success. I've corrected, to my knowledge, my code, but I still have no success in making the email form work. Here is the code:
<?php
if(isset($_POST['enviar'])):
$from=isset($_POST['nome']) ? $_POST['nome'] : '';
$to='my_email@gmail.com';
$subject= isset($_POST['assunto']) ? $_POST['assunto'] : '';
$message=$_POST['mensagem'];
$email=isset($_POST['email']) ? $_POST['email'] : '';
if (mail($to, $subject, $message, 'from'.$email):
$aviso= 'email enviado';
else:
$aviso='falha ao enviar email';
endif;
endif;
?>
<div class="first">
<form action="" method="post">
<label for="name">Nome:</label> <br>
<input id="name" type="text" class="inserir" name="nome" /> <br/>
<label for="mailfrom">E-mail:</label> <br>
<input id="mailfrom" type="text" class="inserir" name="email" /> <br />
<label for="topic">Assunto:</label> <br>
<input id="topic" type="text" name="assunto" class="inserir" /> <br /></div>
<textarea name="mensagem" id="inserirmensagem" placeholder="Digite sua mensagem..." class="inserir"></textarea><br />
<input type="submit" class="enviar" name="enviar" value="Enviar mensagem »"></input>
<?php if(isset($aviso)) echo $aviso; ?>
</form>
</div>