Community discussions

MikroTik App
 
mudasir
Member Candidate
Member Candidate
Topic Author
Posts: 278
Joined: Tue Apr 29, 2008 3:38 am
Location: Karachi, Pakistan
Contact:

Email not being sent

Thu Jun 24, 2010 5:05 pm

Hi,

I am trying to send my systems backup via email tool, but it is unable to send email. I am not getting errors in logs.
:global smtp (:put ([:resolve smtp.gmail.com].":25"))
:global file ([/system identity get name] . [:pick [/system clock get date ] 7 11] . [:pick [/system clock get date ] 0 3] . [:pick [/system clock get date ] 4 6] . ".backup")
/system backup save name=$file
/tool e-mail set server=$smtp
/tool e-mail set username=mudasirmirza@gmail.com
/tool e-mail set password=<password>
/tool e-mail set from=mudasirmirza@gmail.com
/tool e-mail send to=mudasirmirza@gmail.com subject=Backups file=$file
Backup file is being created but not being sent. IP is of smtp.gmail.com. Can anyone help me out in solving this issue.
I can not figure out what is wrong with this.
 
User avatar
maximan
Trainer
Trainer
Posts: 543
Joined: Sat May 29, 2004 12:10 am
Location: Rio Cuarto, Argentina
Contact:

Re: Email not being sent

Thu Jun 24, 2010 7:22 pm

I guess you must to enable TLS for use gmail

M.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Email not being sent

Thu Jun 24, 2010 7:23 pm

Try this:
/tool e-mail
send to=mudasirmirza@gmail.com subject=test body="test"

Does it show up in your mailbox?

ADD: If not:
/tool e-mail print
and set up all applicable entries there.

BTW, resolve doesn't work in some versions of the OS.
 
mudasir
Member Candidate
Member Candidate
Topic Author
Posts: 278
Joined: Tue Apr 29, 2008 3:38 am
Location: Karachi, Pakistan
Contact:

Re: Email not being sent

Thu Jun 24, 2010 7:54 pm

So can you tell me any other way to do so. I contacted my ISP and they gave me another SMTP server but still i am unable to send emails.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Email not being sent

Thu Jun 24, 2010 8:28 pm

As far as I know, there is only two ways of resolving this. The email must be sent through an email server that "trusts" your ip address, or send it to the email server that handles the "to" email account

I would enter the email server ip they issued you in "/tool e-mail", and try it again. Usually, what that means is "we now trust your ip to send email".
 
mudasir
Member Candidate
Member Candidate
Topic Author
Posts: 278
Joined: Tue Apr 29, 2008 3:38 am
Location: Karachi, Pakistan
Contact:

Re: Email not being sent

Fri Jun 25, 2010 3:55 pm

Hi,

Now i am using the code below, still no progress. The ip is provided by my ISP.
:global file ([/system identity get name] . [:pick [/system clock get date ] 7 11] . [:pick [/system clock get date ] 0 3] . [:pick [/system clock get date ] 4 6] . ".backup")
/system backup save name=$file
/tool e-mail set server=203.99.163.178:25
/tool e-mail send to=cool_mudasir@hotmail.com subject=Backups file=$file
Now i am getting
"Error sending E-mail: invalid TO address"
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Email not being sent

Fri Jun 25, 2010 4:07 pm

I have my own email server, so that USUALLY means the email server set in "/tool e-mail" won't forward (relay) email for that ip address. Sometimes I forget to enter the new ip address of a router in my email server, and it will refuse email with that message. Good Email Server!! :D

See if you can connect with telnet from the router
/system
telnet 203.99.163.178 25

You should get a helo message from the email server.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Email not being sent

Tue Jun 29, 2010 2:01 pm

gmail does not work with port #25 they are using #465 (SMPT secure port) if i am not mistaken.
 
bafh
Frequent Visitor
Frequent Visitor
Posts: 83
Joined: Sun Jun 27, 2010 3:59 pm
Location: Libau, Lettland

Re: Email not being sent

Tue Jun 29, 2010 2:14 pm

You are not.
It depends where you want to send those e-mails. Mine and many more servers do not accept connections from such countries as Pakistan, Brazil, Nigeria, China etc. Why? Because they are full of russian spambots! And those 3rd world ISPs do not know how to stop spam with simple firewalls.
Sadly bad nowadays every #$%&#%^*& has a PC but only few know how to use it :(
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Email not being sent

Tue Jun 29, 2010 2:17 pm

resolve smtp.googlemail.com and use port 587
/tool e-mail send body=lala subject=aa to=me@me.com from=router@lala.com server=209.85.227.16:587 password=xxx user=me@gmail.com tls=yes
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Email not being sent

Tue Jun 29, 2010 3:22 pm

I was going by what he used for an email server ip. Resolves to
fe-smtp03.ptcl.net
This email server probably wouldn't relay email for his ip until they set it up for him.

I follow bath's procedure. My email server blocks several countries that can't control spam.
 
bafh
Frequent Visitor
Frequent Visitor
Posts: 83
Joined: Sun Jun 27, 2010 3:59 pm
Location: Libau, Lettland

Re: Email not being sent

Tue Jun 29, 2010 3:24 pm

not mine, mrz said it.

Who is online

Users browsing this forum: No registered users and 29 guests