# Error ZF2 when send mail

**URL:** <https://discourse.laminas.dev/t/error-zf2-when-send-mail/336>\
**Category:** Components & MVC\
**Created:** [October 26, 2017, 3:37am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336 "2017-10-26T03:37:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Temmy\_Alex](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@Temmy\_Alex](https://discourse.laminas.dev/u/Temmy_Alex)\
**Post date:** [October 26, 2017, 3:37am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336/1 "2017-10-26T03:37:13Z")

</div>

Hi  
I have error when send mail ZF2

 ![errormail](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/1X/1dcb873c86ce9718549bb730407e83992c4b7c99.png)

can help with this case?

Thanks

---

<div class="post-metadata">

**Author:** ![Temmy\_Alex](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@Temmy\_Alex](https://discourse.laminas.dev/u/Temmy_Alex)\
**Post date:** [October 26, 2017, 3:39am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336/2 "2017-10-26T03:39:44Z")

</div>

Here is my code

![codemail](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/1X/bf366f509098225e5740327c186268567b6b9868.png)

---

<div class="post-metadata">

**Author:** ![ocramius](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ocramius/32/23_2.png) [@ocramius](https://discourse.laminas.dev/u/ocramius)\
**Post date:** [October 26, 2017, 6:22am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336/3 "2017-10-26T06:22:07Z")

</div>

Heya! Can you please paste code snippets instead of screenshots? Your  
questions can be answered, but nobody will be able to search for similar  
problems because of the errors being in an image rather than in text.

---

<div class="post-metadata">

**Author:** ![Temmy\_Alex](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@Temmy\_Alex](https://discourse.laminas.dev/u/Temmy_Alex)\
**Post date:** [October 26, 2017, 6:38am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336/4 "2017-10-26T06:38:04Z")

</div>

O.K.  
here is my code

[https://codeshare.io/G6x71Q](https://codeshare.io/G6x71Q)

When i try set host with ip numeric not work

---

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [October 26, 2017, 7:42am UTC](https://discourse.laminas.dev/t/error-zf2-when-send-mail/336/5 "2017-10-26T07:42:03Z")

</div>

> [@Temmy\_Alex](#):
>
> When i try set host with ip numeric not work

The error message says something different: “hostname” not “host”.  
You changed also the name of the host:

```
->setName('172.11.1.11')

```

> **[SMTP Options - zend-mail - Zend Framework Docs](https://docs.zendframework.com/zend-mail/transport/smtp-options/#configuration-options)**
>
> Parse, create, store, and send email messages, using a variety of storage and transport protocols.
