Class expects a string, howto pass a variable?

I’m using a contact form that requires a recipient in between single quotes, but I need to pass it from a variable. I’m new to OOP and I’m sure that’s why this isn’t working.

[php]$formproc->AddRecipient(‘[email protected]’);[/php] ^-- what’s expected

[php]$formproc->AddRecipient($recipient);[/php] ^-- what I’m trying to accomplish

anyone please?

There may be a mistake in your function.
can you post that function here?

Here is both the AddRecipient and AddAddress methods:

[php]function AddRecipient($email,$name="")
{
$this->mailer->AddAddress($email,$name);
}[/php]

[php]function AddAddress($address, $name = ‘’) {
$cur = count($this->to);
$this->to[$cur][0] = trim($address);
$this->to[$cur][1] = $name;
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service