Home AMX User Forum NetLinx Studio
Options

SMTP auth?

hi folks

is there a way to send mails with smtp authentification from amx?
i use now !-email (in/out), but now i need the auth.

can anyone give me a help?

thanks a lot

john

Comments

  • Options
    matt95gsrmatt95gsr Posts: 165
    If I'm not mistaken, i!-EquipmentMonitor provides an SMTP authentication mechanism in its email routines. You might want to check that out.
  • Options
    hi
    thanks for your answer. i will check it.

    thanks
    john
  • Options
    hi matt95gsr

    sorry, but the i!-EquipmentMonitor hasn't the auth in it :-(
    i try it today for sending mails. one receiver of my own domain- that works,but when i will send to another receiver, how isn't part of my domainname, the mail will rejected from the smtp server (auth failed!)

    If you know another way , please let me know

    thanks john
  • Options
    viningvining Posts: 4,368
    John_Glove wrote:
    sorry, but the i!-EquipmentMonitor hasn't the auth in it :-(
    i try it today for sending mails. one receiver of my own domain- that works,but when i will send to another receiver, how isn't part of my domainname, the mail will rejected from the smtp server (auth failed!)
    SMTP and POP3 authentication is the username and password of the account holder. Most email servers require it for sending (SMTP) and receiving POP3).

    Look for the following lines in either i!-EquipmentMonitorOut or i!-EquipmentMonitorIn. I'm not exactly sure where as my code has been modified. You need to find out your email servers URL, in the code snippet below are examples for Yahoo. Then you also need to find out what ports it operates on and what alternate port if any. Typically SMTP is on port 25 but as most ISPs block port 25 you'll need to use the alternate. For Yahoo it's 587. The POP3 port should be fine on port 110 as there's no reason for ISPs to block that port.

    If you want to test your email you can telnet your email server directly and display your email in the telnet window. There's about six commands you'll need to know once in.
    //-------------------------------------------------------------------
    //Set Your Local Smtp Server
    //-------------------------------------------------------------------
    //#WARN '!! Configure SMTP email server settings to send email   !!'
    SmtpSetServer('smtp.mail.yahoo.com')
    SmtpSetUser('username','password')  // include only if you need SMTP authentication
    SmtpSetTimeOffset('-0600')
    
    
    //-------------------------------------------------------------------
    //Set Your Pop3 Account Info
    //-------------------------------------------------------------------
    //#WARN '!! Configure POP email server settings to receive email !!'
    Pop3SetServer('pop.mail.yahoo.com')         // Set the Ip of the server
    Pop3SetUser('username','password')     // Set the account user name and password
    Pop3SetRefresh(0,0)                 // How often the check email server in Seconds and should I delete?
    
  • Options
    DHawthorneDHawthorne Posts: 4,584
    John_Glove wrote:
    hi matt95gsr

    sorry, but the i!-EquipmentMonitor hasn't the auth in it :-(
    i try it today for sending mails. one receiver of my own domain- that works,but when i will send to another receiver, how isn't part of my domainname, the mail will rejected from the smtp server (auth failed!)

    If you know another way , please let me know

    thanks john

    This might be a product of the SMTP server, not your code. Most SMTP servers will not accept connections from outside their own name space, correct authorization or not. Conversely, a great many of them don't care at all about authorization as long as the connection comes from their own name space. Unless the ISP providing the SMTP server is set up for allowing this, nothing will get through. You need to send the e-mail as if it were from the SMTP server's domain, not yours. It goes by header information, by the way, not actual point of origin. I've gotten away with using a completely fake e-mail origin in the header, as long as it's within the SMTP server;s name space.
  • Options
    hi vining

    thanks for your answer.
    vining wrote:
    //-------------------------------------------------------------------
    //Set Your Local Smtp Server
    //-------------------------------------------------------------------
    SmtpSetUser('username','password')  // include only if you need SMTP authentication
    

    there is no function call in the out.axi for setting user/pass. can i look also into your function in the out.axi? i think there must be also a function for making the user/pass into base64 coding. this is the simplest auth for smtp.

    thanks
    john
  • Options
    hi dave

    yes, i try with my smtp server from my isp. but when i will send a email outside of my domain i need the auth. no way!
    the smtp server needs auth with base64 coding (user/pass), before sending the FROM: and TO:.

    pat
  • Options
    viningvining Posts: 4,368
    John_Glover wrote:
    yes, i try with my smtp server from my isp. but when i will send a email outside of my domain i need the auth. no way!
    the smtp server needs auth with base64 coding (user/pass), before sending the FROM: and TO:.
    It all depends on your email server. If your email server/provider is the same as your ISP they may or may not require authenication if your connecting from a public IP that is part of the ISP's block of IP they give out to customers. Like wise some ISP email providers may also pass SMTP port 25 on public IPs that are also part of their IP block. If you try to connect from out side the ISP's range of public IPs they most likely will require authetication if they didn't before.

    It all because of spam abuse.

    Both my email accounts require authenication regardless and one is from my ISP.
  • Options
    mpullinmpullin Posts: 949
    vining wrote:
    It all because of spam abuse.
    That, and because of rampant spoofing (sending email that looks like it comes from someone else). Requiring authentication on port 25 won't end spam, but it should help.
  • Options
    hi together.

    so here is is the solution :-)
    i try a little with the smtp-protocoll and include the auth process into the axi.

    so let me know if someone needs the code.

    thanks for all your help.
    john
Sign In or Register to comment.