I have read through and search the forum, but am unable to find a usage demo for swift mailer.
I understand nothing of OOP and have no idea where to start with classes, but really want to give SwiftMailer a bash for my next project!
Can anyone give or point to a good an explaination of how i could inplement SwiftMailer into my program?
At present, I am doing this ...
Code: Select all
if( @$_POST['submitregister'] ){
# VALIDATE AND CLEANSE HERE..
if( $err['errmsg']== '' ){
# no errors as yet, proceed ...
# see if email/username is in DB ...
$sql = "SELECT ...";
$res = mysql_query($sql) or die();
$row = @mysql_fetch_array($res);
if( $row['email'] != '' ){
$err['errmsg'].="@This email address is already in use, and can not be registered again.";
$err['email'] = 1;
}
}
# Do some more validation ...
if( $err['errmsg'] == '' ){
$sql = "INSERT ...";
mysql_query($sql) or $err['errmsg'] = "@Unable to complete your request. Please try again later.";
if( $err['errmsg'] == "" ){
$msg['success'] = "@Your temporary password has now been emailed to to you.";
$msg['success'].= "@Your temporary is".$password;
$body = "Dear ".$clean_data['fname'].",<br>";
$body.= "Thank you for your registration at <a href=".getsettingssingle(3)." target=_blank>".getsettingssingle(2)."</a>";
$body.= "<br><br>Your Login password is ";
$body.= "<br><b>".$password."</b><br><br>Thanks,<br>Webmaster";
$subj = $clean_data['fname'].", Your temporary password for ".getsettingssingle(2);
$head = "From: ".getsettingssingle(1)." \nContent-Type: text/html";
@mail(safe_4_email($clean_data['email']),$subj,$body,$head) or die();
$msg['success'].= "@Your registration is now done. An email containing your temporary password has been emailed to you.";
}
}
}
Code: Select all
mail()I sincerly hope one of you guys can help me out
Des