Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

HTML Page in email body

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HTML Page in email body

    I feel that I am being a little stupid here, but using email_send() how can I include a HTML Page so it displays in the body of an email? (NOT AS A ATTACHMENT) I have tried everything that I can think of but all I get is a blank email. Needless to say "I'm having a bad day"

    Toby

    #2
    Re: HTML Page in email body

    Toby,

    If you use email_send2(), there is a message.Html_Message component that will send the html portion. In addittion, if you also send the message.Message text component, Email_Send2() will use the non-html component if the user's email doesn't accept html bodies.

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      Re: HTML Page in email body

      All of the send email functions can send html in the body. They can send plain text, html text or both as a multipart message. Read the Alpha Help on email_send() if you want to use that function.
      Steve Wood
      See my profile on IADN

      Comment


        #4
        Re: HTML Page in email body

        I see you can use both email_send and email_send2() when you wish to use the email function to include html.

        But, how about placing fields from a table that can be merged into the email body?

        pm.html_message = <<%html%
        <html>
        <head> </head>
        <body>
        Hello [user_name]
        You have registered under the company name of, [Company_name]...
        </body>
        </html>
        %html%
        email_send2(pm)

        Tried everything I can think of.

        Thanks
        Eric

        Alpha Five Websites
        longlivepuppies.com
        socialservicenetwork.com
        -------------------------------------------------
        socialservicenetwork.org

        Comment


          #5
          Re: HTML Page in email body

          Seems like you should be able to put variables within the delimiters, but I've never figured out how. One method that would work is to create your string using delimiters as you have in your post, but put in "mailmerge codes" where you want to insert a variable, for instance ***companyname***. Then, after you create the entire string, use the stritrans() function to replace each occurance of the mergecode with the desired value.

          stritran("mystring","***companyname***",tbl.companyname)

          where mystring is your HTML message.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: HTML Page in email body

            The evaluate_string() function should do what you want.
            Code:
            dim user_name as C = "Eric"
            dim Company_name as C = "Acme Trading Inc"
            
            qq = <<%html%
            <html>
            <head> </head>
            <body>
            Hello {user_name}
            You have registered under the company name of, {Company_name}...
            </body>
            </html>
            %html%
            
            aa = evaluate_string(qq)
            ?aa
            = <html>
            <head> </head>
            <body>
            Hello Eric
            You have registered under the company name of, Acme Trading Inc...
            </body>
            </html>
            Tim Kiebert
            Eagle Creek Citrus
            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

            Comment


              #7
              Re: HTML Page in email body

              Very happy to learn that. I tested the following and it works. note - it does not work to put {tbl.name} directly within the delimiters.

              Code:
              dim tbl as p
              tbl=table.open("prospects")
              thishere = alltrim(tbl.name)
              tbl.close()
              
              body=<<%txt%
              
              replace {thishere} with a local variable 
              
              %txt%
              
              body = evaluate_string(body)
              
              email_send("[email protected]","test",body)
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: HTML Page in email body

                Thank you both for your answers. I took the following example from the help and implemented Tim's suggestion.
                This works

                dim user_name as C = "Eric developer"
                dim Company_name as C = "Big Ice Berg Inc"
                dim pm as P
                pm.lrelated = .T.
                pm.from = "[email protected]"
                pm.from_alias = "Jane Doe"
                pm.to = "[email protected]"
                pm.subject = "Test"
                pm.qq = <<%html%
                <html>
                <head> </head>
                <body>
                Hello {user_name}
                You have registered under the company name of, {Company_name}...
                </body>
                </html>
                %html%
                pm.html_message = evaluate_string(pm.qq)
                email_send2(pm)

                Recipient receives via email: Hello Eric developer You have registered under the company name of, Big Ice Berg Inc...
                Last edited by EricN; 02-25-2008, 03:41 PM.
                Eric

                Alpha Five Websites
                longlivepuppies.com
                socialservicenetwork.com
                -------------------------------------------------
                socialservicenetwork.org

                Comment


                  #9
                  Re: HTML Page in email body

                  Eric, this worked for me.
                  Code:
                  dim user_name as C = "Eric"
                  dim Company_name as C = "Acme Trading Inc"
                  dim pm as P
                  
                  'pm.attachments = " C:\login.jpg "
                  pm.lrelated = .T.
                  pm.from = "[email protected]"
                  pm.from_alias = "Jane Doe"
                  pm.to = "[email protected]"
                  pm.subject = "Test"
                  
                  html_msg = <<%html%
                  <html>
                  <head> </head>
                  <body>
                  Hello {user_name}
                  You have registered under the company name of, {Company_name}...
                  </body>
                  </html>
                  %html%
                  pm.html_message = evaluate_string(html_msg)
                  
                  email_send2(pm)
                  In your code although you 'did' the evaluate_template(qq) you did not assign it to any thing. ie it needs to be assigned to pm.html_message.

                  EDIT: Eric, I did not see your edit before I posted. I see you worked it out.
                  Tim Kiebert
                  Eagle Creek Citrus
                  A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                  Comment


                    #10
                    Re: HTML Page in email body

                    Hello Tim,
                    Yes I did get it figured out. Thanks. For my automatic emails, I use FrontPage to develop my pages. I place the code into them then I copy the code from FrontPage and paste it directly into my a5w code only page between the body and body. The email (code used above) automatically sends the html formatted page to the recipient and it looks great!

                    ----------------------------------------------------------------------------------------------
                    Now I'm trying to develop a "Send to a friend" page using a dialog.

                    I placed the same code in the Aftervalidate

                    If eval_valid("session.Recnum")
                    session.Recnum= lookup("[pathalias.adb_path]\posts","Postnum=" +quote(session.Postnum),"Postnum")
                    end if

                    dim recnum as C = session.Recnum

                    dim pm as P
                    pm.lrelated = .T.
                    pm.from = CurrentForm.Controls.From
                    pm.from_alias = "SSN Administration"
                    pm.to = CurrentForm.Controls.Sendto
                    pm.bcc = "[email protected]"
                    pm.subject = "Job Opportunity"
                    pm.qq = <<%html%
                    <html>
                    <head> </head>
                    <body>
                    this is a test {recnum}
                    </body>
                    </html>
                    %html%
                    pm.html_message = evaluate_string(pm.qq)
                    email_send2(pm)

                    But I get this error!
                    Errors in: event.AfterValidate code:
                    Variable is of different type

                    Any ideas?
                    Last edited by EricN; 02-25-2008, 07:50 PM.
                    Eric

                    Alpha Five Websites
                    longlivepuppies.com
                    socialservicenetwork.com
                    -------------------------------------------------
                    socialservicenetwork.org

                    Comment


                      #11
                      Re: HTML Page in email body

                      There is a free code download on my website for Recommend to a Friend. Look on the For Developers page, section titled Free Alpha Components.

                      Sorry, there is supposed to be about 20 items here, but I am revamping my website and it only shows the one.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: HTML Page in email body

                        Do you mean "Refer A Friend" to let someone know about a website? I developed this for my site a long time ago.
                        OR
                        "Send A Copy Of A Job To A Friend" with several variables which is what I'm now trying to do?
                        Last edited by EricN; 02-25-2008, 08:06 PM.
                        Eric

                        Alpha Five Websites
                        longlivepuppies.com
                        socialservicenetwork.com
                        -------------------------------------------------
                        socialservicenetwork.org

                        Comment


                          #13
                          Re: HTML Page in email body

                          I think the former, its been a year since I looked. But I'm sure the model could be expanded to include variables.
                          Steve Wood
                          See my profile on IADN

                          Comment


                            #14
                            Re: HTML Page in email body

                            Any idea of why I'm getting

                            Errors in: event.AfterValidate code:
                            Variable is of different type

                            in this dialog when it worked in my code only page? Recnum is character but contains numbers.

                            I do have a lot of time invested in this already.
                            Last edited by EricN; 02-25-2008, 08:54 PM.
                            Eric

                            Alpha Five Websites
                            longlivepuppies.com
                            socialservicenetwork.com
                            -------------------------------------------------
                            socialservicenetwork.org

                            Comment


                              #15
                              Re: HTML Page in email body

                              It seems it is my CurrentForm.Controls.??? that is causing the error.

                              How can I get my values from the dialog into the pm. email system?
                              Eric

                              Alpha Five Websites
                              longlivepuppies.com
                              socialservicenetwork.com
                              -------------------------------------------------
                              socialservicenetwork.org

                              Comment

                              Working...
                              X