Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

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

0
movieprodw
Asked:
movieprodw
  • 2
  • 2
1 Solution
 
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
 
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
 
movieprodwAuthor Commented:
Hu, ok I will look into it, thanks,
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now