Developer Network

Documentação

Informações e instruções das APIs dos produtos Locaweb.

PHP

Exemplo de código em PHP para receber os eventos notificados

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
$bounce_description = $_POST['bounce_description'];
$bounce_code           = $_POST['bounce_code'];
$message_sender     = $_POST['sender'];
$message_to             = $_POST['to'];
$message_subject    = $_POST['subject'];
$x_smtplw                 = $_POST['x-smtplw'];

$myfile = fopen("myfile.txt", "a") or die("Unable to open file");
$date = date('m/d/Y H:i:s', time());

$txt = "[$date] bounce_description: $bounce_description\tbounce_code: $bounce_code\tsender: $message_sender\tto: $message_to\tsubject: $message_subject\tx_smtplw: $x_smtplw\n";
fwrite($myfile, $txt);

fclose($myfile);
?>