dongshun5963 2016-04-06 09:23
浏览 22
已采纳

发送电子邮件功能php的电子邮件问题

Please help in resolving this issue where no email is sent. I did have some var_dump($message); and it is okay.

The var_dump is as follows:

string(1591) " Applicants CVs for employer: IF prompted, login with your EMAIL, Password:123456

Name: ROSE MARIE DE GUZMAN | Passport: Passport Download | CV: CV Download

" string(1581) " Applicants CVs for employer: IF prompted, login with your EMAIL, Password:123456

Name: CHERRY BAUTISTA | Passport: Passport Download | CV: CV Download

" string(1622) " Applicants CVs for employer: IF prompted, login with your EMAIL, Password:123456

Name: ALYSSA FAYE SUNGA | Passport: Passport Download | CV: CV Download

    $message = "<html>
                <head>
                    <title></title>
                </head>
                <body>
                    Applicants CVs for employer: IF prompted, login with 

your EMAIL, Password:123456<br><br><tr><td>Name: $fName $lName&nbsp;&nbsp;

</td><br><td>Passport: <a href='http://acf.emmanuelst.com/".$passportPath."' 

target='_blank'>Passport Download</a></td></td><br>CV: <a 

href='http://acf.emmanuelst.com/biodata.php?&idvisa=".$idvisa."&

phoNamePath=".$phoNamePath."&position=".$position."&agent=".$agent."&

emailApp=".$emailApp."&lName=".$lName."&fName=".$fName."&mName=".$mName."&

pAdd=".$pAdd."&perAdd=".$perAdd."&age=".$age."&bDate=".$bDate."&

pBirth=".$pBirth."&sex=".$sex."&languageSpoken=".$languageSpoken."&

height=".$height."&weight=".$weight."&bCivilStatus=".$bCivilStatus."&

bReligion=".$bReligion."&spouse=".$spouse."&emergency=".$emergency."&

telemerCP=".$telemerCP."&hs=".$hs."&hsComplete=".$hsComplete."&

hsGrad=".$hsGrad."&hsDegree=".$hsDegree."&coll=".$coll."&

collComplete=".$collComplete."&collGrad=".$collGrad."&

collDegree=".$collDegree."&voc=".$voc."&vocComplete=".$vocComplete."&

vocGrad=".$vocGrad."&vocDegree=".$vocDegree."&hc=".$hc."&

hcComplete=".$hcComplete."&hcGrad=".$hcGrad."&hcDegree=".$hcDegree."&

local1_post=".$local1_post."&local1_fr=".$local1_fr."&

local1_to=".$local1_to."&local1_name=".$local1_name."&

local1_add=".$local1_add."&local2_post=".$local2_post."&

local2_fr=".$local2_fr."&local2_to=".$local2_to."&

local2_name=".$local2_name."&local2_add=".$local2_add."&

local3_post=".$local3_post."&local3_fr=".$local3_fr."&

local3_to=".$local3_to."&local3_name=".$local3_name."&

local3_add=".$local3_add."&local4_post=".$local4_post."&

local4_fr=".$local4_fr."&local4_to=".$local4_to."&

local4_name=".$local4_name."&local4_add=".$local4_add."&

local5_post=".$local5_post."&local5_fr=".$local5_fr."&

local5_to=".$local5_to."&local5_name=".$local5_name."&

local5_add=".$local5_add."' target='_blank'>CV Download</a>

                    <br>
                    <br>
                </body>
                </html>
                ";
  • 写回答

1条回答 默认 最新

  • douzhanlie9209 2016-04-06 09:29
    关注

    You can use Heredoc, your code will look something like this

    $message = <<<EOF
    <html>
    <head>
    <title></title>
    </head>
    <body>
        Applicants CVs for employer: IF prompted, login with your EMAIL, Password:123456
    <br />
    <table>
    <tr>
        <td>
            Name: $fName $lName
        </td>
        <td>
            Passport: <a href='http://acf.emmanuelst.com/$passportPath' target='_blank'>Passport Download</a>
        </td>
        <td>
            CV: <a href='http://acf.emmanuelst.com/biodata.php?&idvisa=$idvisa&phoNamePath=$phoNamePath&position=$position&agent=$agent&emailApp=$emailApp&lName=$lName&fName=$fName&mName=$mName&pAdd=$pAdd&perAdd=$perAdd&age=$age&bDate=$bDate&pBirth=$pBirth&sex=$sex&languageSpoken=$languageSpoken&height=$height&weight=$weight&bCivilStatus=$bCivilStatus&bReligion=$bReligion&spouse=$spouse&emergency=$emergency&telemerCP=$telemerCP&hs=$hs&hsComplete=$hsComplete&hsGrad=$hsGrad&hsDegree=$hsDegree&coll=$coll&collComplete=$collComplete&collGrad=$collGrad&collDegree=$collDegree&voc=$voc&vocComplete=$vocComplete&vocGrad=$vocGrad&vocDegree=$vocDegree&hc=$hc&hcComplete=$hcComplete&hcGrad=$hcGrad&hcDegree=$hcDegree&local1_post=$local1_post&local1_fr=$local1_fr&local1_to=$local1_to&local1_name=$local1_name&local1_add=$local1_add&local2_post=$local2_post&local2_fr=$local2_fr&local2_to=$local2_to&local2_name=$local2_name&local2_add=$local2_add&local3_post=$local3_post&local3_fr=$local3_fr&local3_to=$local3_to&local3_name=$local3_name&local3_add=$local3_add&local4_post=$local4_post&local4_fr=$local4_fr&local4_to=$local4_to&local4_name=$local4_name&local4_add=$local4_add&local5_post=$local5_post&local5_fr=$local5_fr&local5_to=$local5_to&local5_name=$local5_name&local5_add=$local5_add' target='_blank'>CV Download</a>
        </td>
    </tr>
    </table>
    </body>
    </html>
    EOF;
    // Keep a blank line
    

    I highly recommend you not use a href attribute with so many variables. So for the CV link just use something like this

    CV: <a href='http://acf.emmanuelst.com/biodata.php?&idvisa=$idvisa' target='_blank'>CV Download</a>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置