Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="formulario3" name="formulario3" method="post" enctype="multipart/form-data" action="mail3.php" >
- <label for="Data de Nascimento">Data de Nascimento:</label>
- <input class="tipo1" type="text" name="fale[dtNascimento]" id="dtNascimento" data-required="1" data-title="Data de Nascimento" required>
- <label for="Nome">Nome:</label>
- <input class="tipo2" type="text" name="fale[nome]" id="nome" data-required="1" data-title="Nome" required>
- <label for="email">E-mail:</label>
- <input class="tipo2" type="email" name="fale[email]" id="email" data-required="1" data-title="E-mail" required>
- <label for="Telefone">Telefone:</label>
- <input class="tipo1" type="text" name="fale[telefone]" id="telefone" data-required="1" data-title="Telefone" required>
- <label for="Data da Comemoração">Data da Comemoração:</label>
- <input class="tipo1" type="text" name="fale[dtComemoracao]" id="dtComemoracao" data-required="1" data-title="Data da Comemoração" placeholder="Exemplo: 01/01/2001" required>
- <label for="Mensagem">Mensagem:</label>
- <textarea name="fale[msg]" id="msg" data-required="1" data-title="Mensagem"></textarea>
- <input type="submit" name="enviar" value="Enviar">
- </form>
- <?php
- require_once "phpmailer/class.phpmailer.php";
- $dados = $_REQUEST['fale'];
- $mail = new PHPMailer ();
- $mail->From = $dados['email'];
- $mail->FromName = $dados['nome'];
- $mail->FromNascimento = $dados['dtNascimento'];
- $mail->FromTelefone = $dados['telefone'];
- $mail->FromComemoracao = $dados['dtComemoracao'];
- $mail->FromMensagem = $dados['msg'];
- $mail -> AddAddress ("email@gmail.com");
- $mail -> Subject = "Mensagem";
- $mail -> Body = "<strong style="margin-left:13px; margin-bottom:5px;">DATA DE NASCIMENTO:</strong>".$dados['dtNascimento']."<br/><br/>
- <strong style="margin-left:120px; margin-bottom:5px;">NOME:</strong>".$dados['nome']."<br/><br/>
- <strong style="margin-left:113px;"> EMAIL:</strong><strong style="color:#f00; ">".$dados['email']."</strong><br/><br/>
- <strong style="margin-left:92px; margin-bottom:5px;">TELEFONE:</strong>".$dados['telefone']."<br/><br/>
- <strong margin-bottom:5px;">DATA DE COMEMORAÇÃO:</strong>".$dados['dtComemoracao']."<br/><br/>
- <strong style="margin-left:86px;">MENSAGEM: <em style="text-align:left; display:inline-block; font-style:normal; font-weight:normal">".$dados['msg']."</em></strong><br/>
- ";
- $mail -> IsHTML (true);
- $mail -> IsSMTP(true);
- $mail -> Host = "ssl://smtp.gmail.com";
- $mail -> Port = 465;
- $mail -> SMTPAuth = true;
- $mail -> Username = "email@gmail.com";
- $mail -> Password = "teste";
- if(!$mail->Send()) {
- echo "Erro:".$mail->ErrorInfo;
- }
- else {
- echo "Email enviado!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement