Hello,
I'm very new to PHP. Started learning recently. I'm trying to do something but struggling to find a solution. Hope someone can help me ?
I have a file addon.php which has a variable declared,
$email = 'mynewemail@yahoo.com';
Now I have a php based contact form which is to be used in the website. It has a file contactprocess.php which processes the contact form email. I have to usually change the value to any email address I want the contact form to send to by editing
[U]$mail->AddAddress('[B]myoldemail@yahoo.com[/B]');[/U]
This is the Code in contactprocess.php
$mail = new PHPMailer();
$mail->From = $email;
$mail->FromName = 'Email from my website';
$mail->AddAddress($email);
$mail->AddAddress('myoldemail@yahoo.com');
Now what I'm trying to do is IF I change my addon.php file email value I want it to be changed in contactprocess.php ($mail->AddAddress('myoldemail@yahoo.com')😉 without breaking its functionality !!!
How Can I do this ? Any help guys ? Appreciate it 🙂