2013-02-05 25 views
0

我正在嘗試發送指定發件人的電子郵件。相反,我得到[email protected]即使指定了'from',Drupal 6郵件發送者也被設置爲'Nobody'

$test='example body'.$random_String; 
$message3 = array(
    'to' => '[email protected]', 
    'from' => '[email protected]', 
    //'from' => variable_get('site_mail', '[email protected]'), //alternative doesn't work either 
    'subject' => t('Example subject'), 
    'body' => $test, 
    'headers' => array(), 
); 

drupal_mail_send($message3); 

回答

0

請閱讀drupal_mail_send()函數的文檔。您沒有向drupal_mail_send()提供正確的參數。您錯過了id鍵。 另外,這個功能已經使用PHP的mail(),所以你不必直接使用它。

相關問題