dongli564510 2015-04-10 10:00
浏览 135

如何使用php自行发送带有XAMPP-Mercury Mail的电子邮件

I've been searching a lot, but can't really find what i exactly need.

Im running a shop-online using XAMPP, and what i want is send emails to the customers with their order but using a specific function.

What this fuction does, is to hide some characters (for security purpose) on the email sent to customers. So i've made the function (looking on internet), but i want to test it now.

This is my function (if it's wrong, i'd really appreciate some help):

<?php
 function xtc_hide_iban ($iban) {

$length = strlen($iban);
$lchars = substr($iban,0 ,5);
$rchars = substr($iban, -5);
$iban_hidden = $lchars.str_repeat('*',$length-10).$rchars;
return $iban_hidden;

}
?>

I think it's pretty obvious what i try to do, but i will still explain it:

Get the $iban from customers, and show only the first and last 5 characters when the email is sent e.G

Your IBAN is 'DE123************56789'

So, for now i can send emails from Mercury mail server to 'root@localhost',account i made on thunderbird, (it's the only account that worked for me, because any other with the same server, like 'anyname@localhost' didn't work or couldn't be created, and those who were create with imap before couldn't access to the inbox "could not connected to server, connection refuse", anyway this works with POP3)

Following what i looked before, is that somehow and somewhere i can put a *.php on Mercury folder so i will get a template of how to send the mails (headers, subject,body,etc).

My main question is how and where to do that? make a test php file to make sure my code is doing what i want to do

Thanks in advance

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥65 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?