[SOLVED] Bug on Update data in DB with form

I attach this image, when i click on “UPDATE” or “Actualizar” (in spanish), i received this error.

This is my event ONAFTERUPDATE. This occurs after i add the code for send mail. This is my complete event:

$fecha = date(“Ymd”);
$hora = date(“h:i:s”);

/**

  • Selecting a field from another table
    */

// Check for record
$check_sql = “SELECT ID, Usuario”
. " FROM tabla_usuarios"
. " WHERE usuario = ‘" .[usr_login]. "’";
sc_lookup(rs, $check_sql);
{Administrativo} = {rs[0][0]};

if ({Situacion} == 2) {
$insert_sql = ‘INSERT INTO historial_suscripciones (estado,fecha,hora,usuario,idsuscripcion) VALUES (2,"’.$fecha.’","’.$hora.’","’.{Administrativo}.’","’.{ID}.’")’;
sc_exec_sql($insert_sql);
}
elseif ({Situacion} == 3) {
$insert_sql = ‘INSERT INTO historial_suscripciones (estado,fecha,hora,usuario,idsuscripcion) VALUES (3,"’.$fecha.’","’.$hora.’","’.{Administrativo}.’","’.{ID}.’")’;
sc_exec_sql($insert_sql);

/**
  • Send a simple email
    */

// Email parameters
$mail_smtp_server = ‘smtp.mapemfi.com.ar’; // SMTP server name or IP address
$mail_smtp_user = ‘manueladorni@mapemfi.com.ar’; // SMTP user name
$mail_smtp_pass = ‘economia72’; // SMTP password
$mail_from = ‘manueladorni@mapemfi.com.ar’; // From email
$mail_to = ‘madorni@gmail.com’; // To email
$mail_subject = ‘Operacion’; // Message subject
$mail_message = ‘Operacion aprobada’; // Message body
$mail_format = ‘T’; // Message format: (T)ext or (H)tml
$mail_copies = ‘’; // List of the emails that will recieve the message
$mail_tp_copies = ‘’; // Type copies: BCC (Hiden copies) or CCC (Regular copies)
$mail_port = ‘25’; // Server port
$mail_tp_connection = ‘S’; // Connection security (S) or (N)

// Send email";
sc_mail_send($mail_smtp_server,
$mail_smtp_user,
$mail_smtp_pass,
$mail_from,
$mail_to,
$mail_subject,
$mail_message,
$mail_format,
$mail_copies,
$mail_tp_copies,
$mail_port,
$mail_tp_connection);
}
elseif ({Situacion} == 8) {
$insert_sql = ‘INSERT INTO historial_suscripciones (estado,fecha,hora,usuario,idsuscripcion) VALUES (4,"’.$fecha.’","’.$hora.’","’.{Administrativo}.’","’.{ID}.’")’;
sc_exec_sql($insert_sql);

}

sc_redir(scorings_pendientes_aprobacion.php);

Thanks!!!

Captura de pantalla 2015-06-08 09.34.04.png

This is not a bug in SC.
The mail application is unable to connect to the specified smtp server.
Most likely one or more values of your connection parameters are wrong,
or the email is blocked along the way.
Unfortunately there is no ‘Click here or there’ solution.
You have to figure out if everything is correct (no typo, port, security, AV, Firewall…).

jsb

Ese error a veces aparece si estas conectado en localhost, ya que el servidor de correo no est? configurado.

From what I read your hostname is wrong… Meaning thus this one: smtp.mapemfi.com.ar

Good afternoon.

Change the parameter of connection security for N($mail_tp_connection = ‘N’), this will solve.

Regards,
Scriptcase team.