PHP, smtp auth, load error

Hello,

I am not sure what I am doing wrong but this is my error:

Fatal error: Call to undefined function authSendEmail() in /var/www/vhosts/dd.com/httpdocs/registration.php on line 154

LINE 154 = authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);

$userid = mysql_insert_id();
/* * * * * * * * * * * * * * SEND EMAIL FUNCTIONS * * * * * * * * * * * * * */
 
//Authenticate Send - 21st March 2005
//This will send an email using auth smtp and output a log array
//logArray - connection,
$nameto = "Who To";
$to = $emailA;
$subject = "dd.com - User Varification";
$message = "
Dear $first_name $last_name,
    
Thank you for registering!
    
You are two steps away from joining dd.com.
    
To activate your membership,
please click here: http://www.dd.com/activate.php?id=$userid&code=$db_password
    
Once you activate your membership, you will be able to login with the following information:
 
User name: $username
Password: $random_password
    
Thank you,
dd.com Staff
    
This is an automated response, please do not reply!"; 
$from = "ddemail@dd.com";
authSendEmail($from, $namefrom, $to, $nameto, $subject, $message);
 
 
function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
{
//SMTP + SERVER DETAILS
/* * * * CONFIGURATION START * * * */
$smtpServer = "mail.dd.com";
$port = "25";
$timeout = "30";
$username = "ddemail@dd.com";
$password = "dd";
$localhost = "localhost";
$newLine = "\r\n";
/* * * * CONFIGURATION END * * * * */
 
//Connect to the host on the specified port
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 515);
if(empty($smtpConnect))
{
$output = "Failed to connect: $smtpResponse";
return $output;
}
else
{
$logArray['connection'] = "Connected: $smtpResponse";
}

Open in new window

LVL 1
movieprodwAsked:
Who is Participating?
 
joep1978Commented:
I tried running your code (with the } added) and I didn't get that error.  I think the problem must lie somewhere in the code you have not posted - perhaps a weird parse error in an include file that's preventing the function being read.
0
 
joep1978Commented:
Looks like youre missing a closing } on your function - surprised it isn't throwing a Parse error though
0
 
movieprodwAuthor Commented:
I do have it there I just cut the bottom chunk off the script it just has the redirects
0
 
movieprodwAuthor Commented:
Hu, ok I will look into it, thanks,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.