Languages

Enquiries: info@infomagnet.com / +44 (0)20 7193 3323

Testing drupal_mail() from a PHP block

Sometimes it's useful to test the sending of an email to a specific address w/o configuring/installing any module to do such thing. For that I personally use a PHP snippet that can be executed from the PHP block that comes from the devel module.

Drupal 6.x:

$to = 'email@example.com';
 
$message = drupal_mail('no_module', 'key_not_used', $to, language_default(), array(), null, FALSE);
$message['subject'] = 'Test message';
$message['body'] = 'This is a test message';
// Send e-mail.
dvm(drupal_mail_send($message));

Drupal 7.x:

$my_module = 'no_module';
$my_mail_token = 'no_token';
$from = variable_get('site_mail', ini_get('sendmail_from'));
$message = array(
  'id' => $my_module . '_' . $my_mail_token,
  'to' => 'email@example.com',
  'subject' => 'test',
  'body' => 'test',
  'headers' => array(
    'From' => $from, 
    'Sender' => $from, 
    'Return-Path' => $from,
  ),
);
$system = drupal_mail_system('no_module', $my_mail_token);
if ($system->mail($message)) {
  dpm('ok');
}
else {
  dpm('error');
}
Posted by ariel on April 18th, 2011
Comments: 6

居酒屋。串燒。生啤

居酒屋。串燒。生啤 http://yakitori-izakaya.com/

samba lloret de mar Lloret

samba lloret de mar

Lloret de Mar holidays 2017 have been a favourite choice for the Brits since the 1960s. This means that it’s had plenty of time to accommodate to British holidaymakers, so you can expect a huge selection of bars, restaurants and activities aimed at the British crowd.

Activity-based holidays: Another result of being a built-up resort is that there’s plenty to do on holidays in Lloret de Mar. There’s a huge water park near Lloret de Mar named Waterworld which claims to be one of the largest in Europe. You can also expect to find a medieval castle, elegant botanical gardens and many beautiful churches.

Many beaches: There are over ten beaches in Lloret de Mar, with the main beach Playa de Lloret being a 2km long stretch of golden sand.

Huge choice of nightlife: There are over a hundred bars in Lloret de Mar, so you can imagine it attracts a rather lively crowd after dark. The partying here is very much aimed at British people on their holidays and there’s a street near the old town which is literally lined with bars from end to end.
lloret de mar почтовый индекс

Сварная двутавровая балка

Сварная двутавровая балка Балки сварные двутавровые 10-60см в наличии. 4 склада в Москве. Доставка Новинский ЗМК

cassandra xxx hawaii vice

cassandra xxx hawaii vice 7
RetroPornArchive is just what the name says - a large collection of all kinds of ancient smut, including photos and videos. Gigs of handpicked content that might even feature your grandparents!

vintage lesbian porn free three retro lesbians
candy samples pics sex vintage

Cindy Taylor

WATCH VINTAGE PORN HERE FOR FREE >>> http://classicpornomovies.mobi/
Kostas Doukas
Don Watson

cassandra xxx hawaii vice

cassandra xxx hawaii vice 7
RetroPornArchive is just what the name says - a large collection of all kinds of ancient smut, including photos and videos. Gigs of handpicked content that might even feature your grandparents!

vintage lesbian porn free three retro lesbians
candy samples pics sex vintage

Cindy Taylor

WATCH VINTAGE PORN HERE FOR FREE >>> http://classicpornomovies.mobi/
Kostas Doukas
Don Watson

I don't care about this, now

I don't care about this, now i'm earning average 5000$ a month. There is tricky way i found on the web. If you want to learn it too, just type in google: Hatvesu's Earning Online Strategy

Post new comment

The content of this field is kept private and will not be shown publicly.