Using form emails in AddAdress

0

I have a problem sending email with AddAdress in my php file that is receiving the HTML forumlary data. I've tried everything here but it does not work = '(

Detailing the situation:

I get the address to which I want to send the email here:

$ Email = $ _POST ["Email"];

// It works normal, until use in other points in the code and the string is perfect

$ mail-> AddAddress ($ Email);

// Here it does not catch, but if I put the string it works.

Test to initialize a variable to test like this:

$ test="[email protected]"; $ mail-> AddAddress ($ test, $ Name);

It caught normal.

Test get the value of the $ Email variable but tbm did not get caught in these two ways:

$ test="$ Email"; and $ test = $ Email.

Finally, I do not know what to do, the code is right but the problem is that I can not use the email placed on the form = /

    
asked by anonymous 18.05.2016 / 17:24

1 answer

0

I'm not a ninja in PHP, but who knows, I'll give you a light, in my case it's like that.

$destinatario = (isset($_POST['destinatario'])) ? $_POST['destinatario']: '[email protected]';

// Endereço do e-mail do destinatário

$mail->addAddress($destinatario);

It sends normal to my email

    
30.08.2016 / 00:19