Title: how to code sendemail?
Last modified: August 21, 2016

---

# how to code sendemail?

 *  [cwizards](https://wordpress.org/support/users/cwizards/)
 * (@cwizards)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-to-code-sendemail/)
 * What wp/php code do I use to send an email please?
    e.g. something like ‘wp_smtp(
   to,subject,body);’ ? Nick
 * [http://wordpress.org/plugins/easy-wp-smtp/](http://wordpress.org/plugins/easy-wp-smtp/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [cwizards](https://wordpress.org/support/users/cwizards/)
 * (@cwizards)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-to-code-sendemail/#post-4184133)
 * I have just tried wp_mail(… and got the response below, ant ideas?
    Nick
 * SMTP -> FROM SERVER:220 artificialart.co.uk ESMTP
    SMTP -> FROM SERVER: 250-artificialart.
   co.uk 250-SIZE 20480000 250 AUTH LOGIN SMTP -> FROM SERVER:250 OK SMTP -> FROM
   SERVER:250 OK SMTP -> FROM SERVER:354 OK, send. SMTP -> FROM SERVER:250 Queued(
   0.202 seconds) SMTP -> FROM SERVER:221 goodbye
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/cowleygr/public_html/wp-includes/class-smtp.php:121) in /home/cowleygr/
   public_html/wp-admin/post.php on line 222
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/cowleygr/public_html/wp-includes/class-smtp.php:121) in /home/cowleygr/
   public_html/wp-includes/pluggable.php on line 875
 *  Thread Starter [cwizards](https://wordpress.org/support/users/cwizards/)
 * (@cwizards)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/how-to-code-sendemail/#post-4184138)
 * I am not sending any header info (just to, subject, body) but I am calling the
   code from a hook in functions.php which is called when an admin user clicks publish
   on a post.
    It looks to me as though it is trying to set a cookie or something?
   Nick

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘how to code sendemail?’ is closed to new replies.

 * ![](https://ps.w.org/easy-wp-smtp/assets/icon.svg?rev=3158017)
 * [Easy WP SMTP – WordPress SMTP and Email Logs: Gmail, Office 365, Outlook, Custom SMTP, and more](https://wordpress.org/plugins/easy-wp-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-wp-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-wp-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-wp-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-wp-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-wp-smtp/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [cwizards](https://wordpress.org/support/users/cwizards/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/how-to-code-sendemail/#post-4184138)
 * Status: not resolved