Hi Al,<br><br>We have different email contents and subject depending in the action that the customer had taken, since our service is a Prepaid card. What I did, was to use an AGI to have this flexibility. After getting the caller id and querying it in the DB, I will then construct the email that will be sent to the customer.
<br><br>[nihonggo-temporary-registration]<br>exten => readnum,1,Set(REGPHONE=${CALLERIDNUM})<br>exten => 2,1,AGI(preRegist.agi,${REGPHONE})<br>exten => 2,2,AGI(sendEMAILnotification.agi,${REGPHONE})<br><br>AGI script..
<br><br>sub mailSend { <br> my ($subj, $body) = @_;
<br> my(@da, @day, @mon, $datetime, $expTO, $mail, $head);
<br> @da = localtime(time);
<br> @day = qw(Sun Mon Tue Wed Thu Fri Sat);
<br> @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
<br> $datetime = sprintf "%s, %02d %s %d %02d:%02d:%02d +0900",
<br> ($day[$da[6]], $da[3]*1, $mon[$da[4]], $da[5]+1900,
<br> $da[2]*1, $da[1]*1, $da[0]*1);
<br> <br> $body = Jcode->new($body)->h2z->jis;
<br> <br> $head = "Return-Path: <$m_RETPATH>\n";
<br> $expTO = join(",\n ", @m_MAILTO);
<br> $head .= "To: $expTO\n";
<br> $head .= "From: $m_FROM\n";
<br> $head .= "Date: $datetime\n";
<br> $head .= "Content-type: text/plain; charset=iso-2022-jp\n";
<br> $head .= "Subject: $subj\n";
<br> $head .= "\n";
<br> <br> $head = &mimeencode($head);
<br> <br> $mail = "$head$body";
<br> <br> if (open (OUT, "|$QIPATH")) { # qmail-inject
<br> $mail =~ s/%/%%/g;
<br> printf OUT "$mail";
<br> close (OUT);
<br> }
<br>}<br><br>Hope that helps.<br><br>Best Regards,<br>Joanna<br><a href="http://www.mariazeta.com">www.mariazeta.com</a><br><br><br><br><br><br>