Shop OBEX P1 Docs P2 Docs Learn Events
Pink & Email — Parallax Forums

Pink & Email

Mike2545Mike2545 Posts: 433
edited 2010-07-12 01:20 in BASIC Stamp
I have my PINK set up to send emails, but the message content is always blank. Has anyone else had this issue?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike2545

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-04 22:14
    As with any problem, how about attaching your program source to your message. I would suggest you carefully go through the description in the documentation on sending e-mail and check to make sure each of the required steps is done in your program. I don't have my PINK documentation handy, but I remember a list of variables all of which have to be set up properly.
  • Mike2545Mike2545 Posts: 433
    edited 2010-02-04 23:22
    Mike you are right, I should have included it in my first post...

    ' =========================================================================
    '
    '   File...... PINKSendEMail.bs2
    '   Purpose... Send Test E-Mail From PINK Module via BASIC Stamp 2
    '   Author.... Parallax, Inc.
    '   E-mail.... support@parallax.com
    '   Started...
    '   Updated... 09-10-2007
    '
    '   {$STAMP BS2e}
    '   {$PBASIC 2.5}
    '
    ' =========================================================================
    
    
    ' -----[noparse][[/noparse] Program Description ]---------------------------------------------
    
    ' This program demonstrates how to send e-mail using the PINK Module.  You
    ' must replace the various data below with your actual addresses and server
    ' information before running this example.  Once run the program will
    ' display a success or failure message.  optional parameters can be omitted
    ' by commenting out the appropriate SEROUT line in the code.  NOTE: Not all
    ' SMTP servers will be compatible with the PINK Module.  It is up to the
    ' customer to make that determination.  Parallax Tech Support cannot assist
    ' with mail server issues.
    
    
    ' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
    
    RX              PIN     14              ' Serial Receieve Pin --> PINK.TX
    TX              PIN     15              ' Serial Transmit Pin --> PINK.RX
    
    
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    
    Baud            CON     396             ' 2400 bps (BS2)
    
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    
    nbvar           VAR     Byte            ' PINK Data Variable
    busy            VAR     nbvar.BIT2      ' E-Mail Busy Flag (Alias)
    complete        VAR     nbvar.BIT4      ' E-Mail Complete Flag (Alias)
    
    
    ' -----[noparse][[/noparse] Program Code ]----------------------------------------------------
    
    Main:
      ' Set TO Address
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WET:support@bex.net", CLS]
      ' Set FROM Address
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEF:*******@***.net", CLS] 'left blank to protect privacy
      ' Set SUBJECT
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WES:Test Message From PINK", CLS]
      ' Set MESSAGE CONTENT
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEC:testing 123", CLS]
      ' Set SMTP Server
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEV:mail.bex.net", CLS]
      ' Set USERNAME (Optional On Some Servers)
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEU:*******", CLS] 'left blank to protect privacy
      ' Set PASSWORD (Optional On Some Server)
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEP:******", CLS]  'left blank to protect privacy
      ' Set AUTH ON/OFF (Optional On Some Servers)
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEA:1", CLS]   ' Turn Authentication On (Optional)
    
      SEROUT TX, Baud, [noparse][[/noparse]"!NB0SM"]           ' Command To Send E-Mail
    
      DO
        SEROUT TX, Baud, [noparse][[/noparse]"!NB0ST"]         ' Send Command To Read Variable
        SERIN  RX, Baud, 1000, Timeout, [noparse][[/noparse]nbvar]' Get One Byte With Timeout
      LOOP WHILE busy = 1
    
      IF complete = 1 THEN
        DEBUG CLS, "MAIL SENT SUCCESSFULLY!", CR
      ELSE
        DEBUG CLS, "MAIL SEND FAILURE!", CR
      ENDIF
      END
    
    Timeout:
      DEBUG "Communication Timeout!"        ' Serial Timeout
      END
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545
  • Mike2545Mike2545 Posts: 433
    edited 2010-02-04 23:23
    I should mention, I get an email, its just blank... with Test Message From PINK as the subject

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545
  • JDJD Posts: 570
    edited 2010-02-05 00:04
    Mike2545,

    Have you ever gotten it to work before? Can you get the demo to work (see below)? In the IP Tool, what is the firmware version?

    :Sample Snippet:

    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WET:someone@somewhere.com", CLS]
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEF:PINK@parallax.com", CLS]
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WES:Test Message From PINK", CLS]
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEC:Message Content Goes Here!",CLS]
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEV:smtp.server.com", CLS]
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEU:username", CLS] ' (Optional)
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEP[noparse]:p[/noparse]assword", CLS] ' (Optional)
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEA:1", CLS] ' Turn Authentication On (Optional)
    ·SEROUT TX, Baud, [noparse][[/noparse]"!NB0SM"] ' Command To Send E-Mail

    :Sample End:



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • Mike2545Mike2545 Posts: 433
    edited 2010-02-05 00:14
    Joshua, no this is the first time I have attempted to get the email feature to work, I contacted my ISP to provide the SMTP .Com info and later to see if it was an issue on their end. They got the same blank emails I was getting.

    This is the same module I had issues with the password, your tech support put new firmware in and sent it back...Firmware Version: SB70 Parallax Web server 1.33


    Regards

    Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545
  • JDJD Posts: 570
    edited 2010-02-05 01:04
    Mike,

    Ah, then I know which module you have. Let me see if I can set one up and duplicate the issue. I have not heard of any problems regarding the email and from what it looks like the syntax is all correct.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • AJColAJCol Posts: 1
    edited 2010-07-12 01:20
    Hello,
    I am having the same issue as Mike2545. Mail is sent, has a subject, but no message in the body. If I look in the header, the message is there. I am using the same mail program. The module is a PINK SB70 and I upgraded with the ParallaxR1p35_APP.s19 file.
    AJ

    Here is the code:
    ' =========================================================================
    '
    ' File...... PINKSendEMail.bs2
    ' Purpose... Send Test E-Mail From PINK Module via BASIC Stamp 2
    ' Author.... Parallax, Inc.
    ' E-mail.... support@parallax.com
    ' Started...
    ' Updated... 09-10-2007
    '
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    ' =========================================================================
    '
    [noparse][[/noparse] Program Description ]
    ' This program demonstrates how to send e-mail using the PINK Module. You
    ' must replace the various data below with your actual addresses and server
    ' information before running this example. Once run the program will
    ' display a success or failure message. optional parameters can be omitted
    ' by commenting out the appropriate SEROUT line in the code. NOTE: Not all
    ' SMTP servers will be compatible with the PINK Module. It is up to the
    ' customer to make that determination. Parallax Tech Support cannot assist
    ' with mail server issues.

    '
    [noparse][[/noparse] I/O Definitions ]

    RX PIN 14 ' Serial Receieve Pin --> PINK.TX
    TX PIN 15

    ' Serial Transmit Pin --> PINK.RX'
    [noparse][[/noparse] Constants ]

    Baud CON 396 ' 2400 bps (BS2)

    '
    [noparse][[/noparse] Variables ]

    nbvar VAR Byte ' PINK Data Variable
    busy VAR nbvar.BIT2 ' E-Mail Busy Flag (Alias)
    complete VAR nbvar.BIT4 ' E-Mail Complete Flag (Alias)
    Temper VAR Word

    '
    [noparse][[/noparse] Program Code ]
    Main:
    HIGH 0
    PAUSE 100
    RCTIME 0, 1, Temper

    ' Set TO Address
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WET:xxxxxx@xxxxxxx.xxx", CLS]
    ' Set FROM Address
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEF:xxxxxx@xxxx.xxxxxx.xxx", CLS]
    ' Set SUBJECT
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WES:Test Message", CLS]
    ' Set MESSAGE CONTENT
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEC:Temp is ",DEC Temper,CLS]
    ' Set SMTP Server
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEV:xxxx.xxxxxx.xxx", CLS]
    ' Set USERNAME (Optional On Some Servers)
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEU:xxxxxx", CLS]
    ' Set PASSWORD (Optional On Some Server)
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEP:xxxxxx", CLS]
    ' Set AUTH ON/OFF (Optional On Some Servers)
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0WEA:1", CLS] ' Turn Authentication On (Optional)

    SEROUT TX, Baud, [noparse][[/noparse]"!NB0SM"] ' Command To Send E-Mail

    DO
    SEROUT TX, Baud, [noparse][[/noparse]"!NB0ST"] ' Send Command To Read Variable
    SERIN RX, Baud, 1000, Timeout, [noparse][[/noparse]nbvar]' Get One Byte With Timeout
    LOOP WHILE busy = 1

    IF complete = 1 THEN
    DEBUG CLS, "MAIL SENT SUCCESSFULLY!", CR
    ELSE
    DEBUG CLS, "MAIL SEND FAILURE!", CR
    ENDIF
    END

    Timeout:
    DEBUG "Communication Timeout!" ' Serial Timeout
    END
Sign In or Register to comment.