【问题标题】:mail to in an existing php code邮寄到现有的 php 代码
【发布时间】:2015-04-29 04:14:41
【问题描述】:

我有这个代码:

if($this->helix3->getParam('contact_email')) $output .= '<li class="sp-contact-email"><i class="fa fa-envelope"></i> ' . $this->helix3->getParam('contact_email') . '</li>';

        $output .= '<ul>';

        return $output;

我希望在首页点击会发送一封电子邮件到 getParam('contact_email') 的结果

【问题讨论】:

    标签: php mailto


    【解决方案1】:

    如果我理解正确,您需要在 href 中使用带有 mailto: 的锚标记:

    if($this->helix3->getParam('contact_email')){
      $email=$this->helix3->getParam('contact_email');
      $output .= '<li class="sp-contact-email"><i class="fa fa-envelope"></i> <a href="mailto:'.$email.'">' . $email . '</a></li>';
    }
    
            $output .= '<ul>';
    
            return $output;
    

    【讨论】:

    • 是的...在网站的前端我只能看到邮箱xxx@123.com,但不能点击它发送邮件
    • 这应该可以,我已经测试过了....&lt;a href="mailto:user@domain.com"&gt;send mail&lt;/a&gt;这基本上是上面的结果
    • thx trey...我觉得自己又蠢又累。你给了我光 if($this->helix3->getParam('enable_contactinfo')) { $output = '
        '; if($this->helix3->getParam('contact_email')) $output .= '
      • xxx@xxx.it
      • ' . $output .= '
          ';返回 $output;
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-30
    相关资源
    最近更新 更多