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条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器