F
F
freeman02042018-03-10 21:14:33
WordPress
freeman0204, 2018-03-10 21:14:33

How to properly use the wp_mail function?

$download_form = get_field("download_form", 489);
  if($download_form) {
    $attachments = $download_form['url'];
    wp_mail('[email protected]', 'тема', 'сообщение', $attachments);
  }

There is an acf file field named download_form. I put it in the $download_form variable and measure if there is a file in it, then I send an email and attach this file to it. But nothing comes.
Even if I just take this line wp_mail('[email protected]', 'subject', 'message'); then it comes through once and not immediately. How to set up normal email sending and how to attach a file, as in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-03-10
@freeman0204

Does the wp_mail function itself work fine without ACF? Simply, sometimes it happens that letters get into SPAM or arrive with a delay. Try the same with the enabled plugin https://ru.wordpress.org/plugins/wp-mail-smtp/
and don't forget to configure smtp forwarding. Maybe it will help)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question