###前提、実現したいこと
phpでお問い合わせフォームを作成しており、mb_send_mailを利用してメールを送信します。
送り元のドメインがicloud.comの場合エラーが返ってきて、ezweb.ne.jpだとエラーが出ません。
なぜicloud.comだとエラーが出るのでしょうか。
詳しい方、どうかご教授ください。
省略以下
PHP
1<?php 2 3 // メールの言語設定 4 mb_language("Japanese"); 5 mb_internal_encoding("UTF-8"); 6 $to_email = 省略; 7 8 9 // メール本文 10 $message = "お問い合わせがありました。\n"; 11 $message .= "\n"; 12 $message .= "以下省略。\n"; 13 14 // メール本文 ユーザー 15 $message_user = "※このメールは自動的に返信されたメールです。\n"; 16 $message_user .= "\n"; 17 $message_user .= "この度はお問い合せ頂き誠にありがとうございました。\n"; 18 $message_user .= "以下省略"; 19 20 21 // 送信元のメールアドレスを変数に格納 22 $from_email = '省略@icloud.com'; 23 //送信元の名前を変数に格納 24 $from_name = 'メールテスト'; 25 26 // mb_encode_mimeheaderに渡す前にUTF-8に変換しなくてはダメ 27 $from_encoded = mb_convert_encoding($from_name, 'UTF-8', 'AUTO'); 28 //ヘッダ情報を変数に格納 29 $headers = 'From: ' . mb_encode_mimeheader($from_encoded) . '<' . $from_email . '>'; 30 31 $addParam = '-f' . $from_email; 32 33 mb_send_mail( $to_email, 'お問い合わせありがとうございます!', $message_user, $headers, $addParam); 34 35 ?> 36 37<!-- ヘッダー --> 38<?php get_header(); ?> 39 40 <!-- メニュー --> 41 <?php get_template_part('content', 'menu'); ?> 42 43 <!-- メイン --> 44 <main class="contact scrollFade"> 45 <?php if(mb_send_mail( $from_email, 'お問い合わせがありました!', $message, $headers, $addParam)):?> 46 <div class=""> 47 <p> 48 お問い合わせの送信を完了いたしました。 49 </p> 50 </div> 51 <?php else: ?> 52 <div> 53 <p> 54 送信失敗しました 55 </p> 56 </div> 57 <?php endif; ?> 58 </div> 59 </main> 60 61 <!-- フッター --> 62 <?php get_footer(); ?> 63
1mail delivery system 2undelivered mail returned to sender 3 4This is the mail system at host mailgw1005.conoha.ne.jp. 5 6I'm sorry to have to inform you that your message could not 7be delivered to one or more recipients. It's attached below. 8 9For further assistance, please send mail to postmaster. 10 11If you do so, please include this problem report. You can 12delete your own text from the attached returned message. 13 14 The mail system 15 16<省略@icloud.com>: host mx01.mail.icloud.com[17.57.155.34] said: 554 17 5.7.1 [HM08] Message rejected due to local policy. Please visit 18 https://support.apple.com/en-us/HT204137 (in reply to end of DATA command) 19Reporting-MTA: dns; mailgw1005.conoha.ne.jp 20X-Postfix-Queue-ID: DA525100D7072 21X-Postfix-Sender: rfc822; 省略@icloud.com 22Arrival-Date: Mon, 18 Sep 2023 12:21:59 +0900 (JST) 23 24Final-Recipient: rfc822; 省略@icloud.com 25Original-Recipient: rfc822;省略@icloud.com 26Action: failed 27Status: 5.7.1 28Remote-MTA: dns; mx01.mail.icloud.com 29Diagnostic-Code: smtp; 554 5.7.1 [HM08] Message rejected due to local policy. 30 Please visit https://support.apple.com/en-us/HT204137

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。