私はここに私のWordpressのテーマ にカスタムフォームを使用しています私の形であるイメージのURLを取得し、Wordpressを使用してカスタムフォームで送信する前にメールを送信する方法は?
HTML
<form accept-charset = "UTF-8" action = "https://forexmplesecondsite.com/get_form_data" method = "POST" target = "_blank" enctype="multipart/form-data">
<label for="customer-name"> your name *</label>
<input type="text" id="customer-name" name="customer-name" />
<label for="company-name"> your company name *</label>
<input type="text" id="company-name" name="company-name" />
<input type="file" name="customer-logo" />
<input type="submit" value="upload" id="upload-form">
</form>
jQueryの
jQuery(document).ready(function ($) {
$("#upload-form").click(function(){
<?php
$to = '[email protected]';
$subject = "my mail subject";
$message = "please check logo attachment";
$headers = array(
‘From: My Name <[email protected]>;',
'BCC: My Other Name <[email protected]>;',
);
$attachments=$_FILES['customer-logo']['tmp_name'];
wp_mail($to, $subject, $message, $headers , $attachments);
?>
});
});
誰かが提出をクリックすると、フォームは他にリダイレクトサイトと私はメールを持っていますが、私は添付ファイルが表示されません。
私は見ることができるだけでなく、PHPに新しいです:) – madalinivascu
アップロードされたファイルを処理する必要があります( 'move_uploaded_file($ tmpname、$ '$ target'を添付ファイルとして使用します。 – RamRaider