# TypeError: Cannot create property 'mailer' on string 'smtp'

**URL:** <https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949>\
**Category:** Installation\
**Created:** [April 29, 2020, 5:19pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949 "2020-04-29T17:19:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 5:19pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/1 "2020-04-29T17:19:41Z")

</div>

Unable to setup a mail configuration with google on Ghost v3.8.  
Please find the mail properties on config.production.json  
“mail”: {  
“service”: “Gmail”,  
“transport”: “SMTP”,  
“options”: {  
“host”: “[smtp.gmail.com](http://smtp.gmail.com)”,  
“port”: 465,  
“secureConnection”: true,  
“auth”: {  
“user”: “**@gmail.com",  
“password”: "**\*\*\*\*\*\*”  
}  
}  
},  
This is the error i’am getting when trying to restart ghost with above configuration.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/4/4a1d81a1c274bb1ffb44018213fe70c315833885.png)

---

<div class="post-metadata">

**Author:** ![inoryum](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/inoryum/32/11866_2.png) [@inoryum](https://forum.ghost.org/u/inoryum)\
**Post date:** [April 29, 2020, 6:47pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/2 "2020-04-29T18:47:39Z")

</div>

Did you tried with less secure password on gmail account setting?  
& also use downcase

```auto
“service”: “gmail”,

```

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 7:18pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/3 "2020-04-29T19:18:14Z")

</div>

@inoryum  
I tried both less secure password on gmail, lowercase as “gmail”. But of no luck.  
my config.production.json path is: /var/www/ghost/core/server/config/env

---

<div class="post-metadata">

**Author:** ![inoryum](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/inoryum/32/11866_2.png) [@inoryum](https://forum.ghost.org/u/inoryum)\
**Post date:** [April 29, 2020, 7:33pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/4 "2020-04-29T19:33:23Z")

</div>

Can you check the user has correct permission?  
check if the folder have 775 permission  
EG

```auto
sudo chmod 775 /var/www/ghost

```

& your current user is the owner of the folder

for Example

```auto
sudo chown $USER:$USER /var/www/ghost

```

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 7:47pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/5 "2020-04-29T19:47:46Z")

</div>

@inoryum I did gave it a try, no luck .

---

<div class="post-metadata">

**Author:** ![inoryum](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/inoryum/32/11866_2.png) [@inoryum](https://forum.ghost.org/u/inoryum)\
**Post date:** [April 29, 2020, 7:55pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/6 "2020-04-29T19:55:28Z")

</div>

Oke last thing can you check on your server if the quotes are this`" "` instead of`“ ”`?

Can can you send me a screenshot of your config.json file hiding your password & email?

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 8:16pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/7 "2020-04-29T20:16:57Z")

</div>

@inoryum Please find the screenshot of config.production.json

![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/7/7b7adc4d48510d7f584a19043ba1fa5191b27baf.png)

---

<div class="post-metadata">

**Author:** ![inoryum](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/inoryum/32/11866_2.png) [@inoryum](https://forum.ghost.org/u/inoryum)\
**Post date:** [April 29, 2020, 8:36pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/8 "2020-04-29T20:36:18Z")

</div>

Use the following config i trimed some of config & let me know. I have checked the following in my server working good… Make sure u turned off less secure app from your gmail account

```auto
"mail": {
    "from": "yourfromname<email@gmail>",
    "transport": "SMTP",
    "options": {
        "host": "smtp.gmail.com",
        "port": 587,
        "auth": {
            "user": "user@gmail.com",
            "pass": "password"
        }
    }
},

```

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 8:47pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/9 "2020-04-29T20:47:02Z")

</div>

Replaced the config of yours, it’s the same error again.  
"Cannot create property ‘mailer’ on string ‘SMTP’ "

---

<div class="post-metadata">

**Author:** ![inoryum](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/inoryum/32/11866_2.png) [@inoryum](https://forum.ghost.org/u/inoryum)\
**Post date:** [April 29, 2020, 8:59pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/10 "2020-04-29T20:59:12Z")

</div>

Okay seems its not a config issue… but i am suspecting the issue with the nodemailer… may be we should wait for some experts to answer on this.  
@John@egg

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 29, 2020, 9:07pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/11 "2020-04-29T21:07:58Z")

</div>

@inoryum Just FYI, the current versions that I have are  
“nodemailer”: “^6.4.2”,  
“nodemailer-smtp-transport”: “^2.7.4”,

---

<div class="post-metadata">

**Author:** ![egg](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/egg/32/1691_2.png) [@egg](https://forum.ghost.org/u/egg)\
**Post date:** [April 30, 2020, 9:10am UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/12 "2020-04-30T09:10:59Z")

</div>

The nodemailer version used by Ghost is 0.7.1 [Ghost/package.json at main · TryGhost/Ghost · GitHub](https://github.com/TryGhost/Ghost/blob/master/package.json#L120)

Did you change this manually @workman?

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [April 30, 2020, 2:15pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/13 "2020-04-30T14:15:24Z")

</div>

Nope by default, I have this nodemailer 6.4.2 installed.

---

<div class="post-metadata">

**Author:** ![egg](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/egg/32/1691_2.png) [@egg](https://forum.ghost.org/u/egg)\
**Post date:** [April 30, 2020, 2:21pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/14 "2020-04-30T14:21:04Z")

</div>

Okay, well by default the nodemailer version is 0.7.1 🤔

How did you install Ghost?

I would try removing your `node_modules` directory and running `yarn` to reinstall the correct versions of dependencies

---

<div class="post-metadata">

**Author:** ![workman](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@workman](https://forum.ghost.org/u/workman)\
**Post date:** [May 1, 2020, 6:25pm UTC](https://forum.ghost.org/t/typeerror-cannot-create-property-mailer-on-string-smtp/13949/15 "2020-05-01T18:25:34Z")

</div>

Installing the nodemailer version 0.7.1 worked for me.  
Thanks for all your time and help @egg @inoryum.
