您可以使用wp_mail( $to, $subject, $message, $headers, $attachments );
发送带有附件的电子邮件。
所以你只需要一个简单的表单
<form name="email-att" id="email-att" method="POST" action="">
Enter your emial: <br />
<input type="text" name="email" id="email"/><br />
<input type="hidden" name="action" value="email-att"/><br />
<input type="submit" name="submit" value="submit" id="submit"/>
</form>
并对其进行处理
<?php
if (isset($_POST[\'action\']) && $_POST[\'action\'] == "email-att"){
if (is_email($_POST[\'email\'])){
$to = $_POST[\'email\'];
$subject = "email subject line";
$message = "email message body";
$attachments = array(\'http://full_url_to_file.zip\');
wp_mail( $to, $subject, $message, \'\', $attachments );
echo \'mail sent! check your email\';
}else{
echo \'Please enter a valid email address \';
}
}
?>