if

i use this code and works, but the problem is, that the first if print a code, but execute the code of sc_mail_send, i not want, anyone explain, i want only execute print with first if.

// Send email";

if($email == ‘’){

print("Il cliente non ha una email!!!");

}

if($email != ‘’){
print(‘Email inviata’);

{
sc_mail_send($mail_smtp_server,
$mail_smtp_user,
$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format);

}

}

See:
http://php.net/manual/en/language.operators.comparison.php
http://php.net/manual/en/types.comparisons.php

if ($email === ‘’)
{

}
else
{

}

I must include this macro: sc_error_exit();

if($email == ‘’){

print(“Il cliente non ha una email!!!”);
sc_error_exit();

}

I think this is what you are looking for:

if ($email == '') {[INDENT]print("Il cliente non ha una email!!!");
[/INDENT]
 }
else {[INDENT]print('Email inviata');[/INDENT]
[INDENT]sc_mail_send($mail_smtp_server,[/INDENT]
[INDENT=2]$mail_smtp_user,
[/INDENT]
[INDENT=2]$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format);
[/INDENT]
 }

Dave

ok, works fine. If possible have an error is not possible send email if smtp not works

I don’t know if it works as the error starts on the socket, but you might try to set your sourcecode within a try… catch. see http://php.net/manual/en/language.exceptions.php

if difficult for me