如何在drupal 7中发送电子邮件(how to send email in drupal 7)

编程入门 行业动态 更新时间:2024-10-27 02:30:24
如何在drupal 7中发送电子邮件(how to send email in drupal 7)

有没有人可以帮助一个示例源代码在drupal 7中发送电子邮件?任何人都可以使用contact_submit函数来使用drupal_mail() 。 我正在使用自定义模块:

function contact_menu() { $items['contact'] = array( 'title' => 'contact form', 'page callback' => 'drupal_get_form', 'page arguments' => array('contact_form'), 'access arguments' => array('access content'), ); return $items; } function contact_form() { $form['intro'] = array( '#markup' => t('Use this form to send a message to an e-mail address. No spamming!'), ); $form['email'] = array( '#type' => 'textfield', '#title' => t('E-mail address'), '#required' => TRUE, ); $form['message'] = array( '#type' => 'textarea', '#title' => t('Message'), '#required' => TRUE, ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), ); return $form; } function contact_validate($form, &$form_state) { if (!valid_email_address($form_state['values']['email'])) { form_set_error('email', t('That e-mail address is not valid.')); } } function contact_form_submit($form, &$form_state) { //What i should write here ??? }

Does any can help with an example source code to send email in drupal 7. Can any one help with the contact_submit function to use drupal_mail(). I'm using custom module :

function contact_menu() { $items['contact'] = array( 'title' => 'contact form', 'page callback' => 'drupal_get_form', 'page arguments' => array('contact_form'), 'access arguments' => array('access content'), ); return $items; } function contact_form() { $form['intro'] = array( '#markup' => t('Use this form to send a message to an e-mail address. No spamming!'), ); $form['email'] = array( '#type' => 'textfield', '#title' => t('E-mail address'), '#required' => TRUE, ); $form['message'] = array( '#type' => 'textarea', '#title' => t('Message'), '#required' => TRUE, ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), ); return $form; } function contact_validate($form, &$form_state) { if (!valid_email_address($form_state['values']['email'])) { form_set_error('email', t('That e-mail address is not valid.')); } } function contact_form_submit($form, &$form_state) { //What i should write here ??? }

最满意答案

示例模块包含许多开始使用的示例,包括电子邮件。 在这里看到它在api网站查看drupal_mail()函数来查看函数参数和用户示例以及函数的使用。

GIYF。

Examples module contains number of examples to get started with, including emails. see it in api site here See drupal_mail() function to see function params and user examples as well as function use.

GIYF.

更多推荐

本文发布于:2023-08-04 15:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1417738.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发送电子邮件   如何在   email   drupal   send

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!