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

How to insert a signature image into an email

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

    How to insert a signature image into an email

    Hi All

    We like to include a small App within our applications so the Runtime user can send emails from within the App.

    We would like to be able to show their logo as a signature at the end of the message can anyone please modify the script on the Send button of the attached application. The script at the moment sends the email and creates a log table. I have been using function Email_send2().

    Grateful if someone could modify this script to show the Cards image.

    Michael
    Attached Files

    #2
    Re: How to insert a signature image into an email

    Michael,

    I believe you'll have to use the html_message sub variable to include an inline image. You will need to reference the image by the path on the machine where the script is run.

    Code:
    Parentform.commit()
    t=table.current()
    dim message as P
    
    message.message = t.message
    message.from_alias=t.from
    If t.attachpath<>"" then
    message.attachments=rtrim(t.ATTACHPATH)
    End If
    message.1related = .t.
    message.to = t.address
    message.subject = t.subject
    [COLOR="#FF0000"]message.html_message = <<%html%
    This is a message with an 
    <img src="C:\tempdb\Emailsender\cards.png">
    inline image.
    %html%[/COLOR]
    'silent, store in mailbox,autowrap all set to false
    result=email_send2(message, "", .F., .F., .F.)
    if result=.t. then
        ui_msg_box("Note","Email sent")
        ELSE
    ui_msg_box("Note","Email failed")
    END
    End If
    There can be only one.

    Comment


      #3
      Re: How to insert a signature image into an email

      I just noticed that the code suggested displays the image in the email if it is viewed on a machine where the image exists in the location specified. If you reference a web based image such as

      <img src="http://www.alphasoftware.com/images/awards.gif">

      then it will display while online.
      There can be only one.

      Comment


        #4
        Re: How to insert a signature image into an email

        Hi Michael,

        What about saving the image in the Code tab? Then it will be available in the runtime, wont it?
        Regards
        Keith Hubert
        Alpha Guild Member
        London.
        KHDB Management Systems
        Skype = keith.hubert


        For your day-to-day Needs, you Need an Alpha Database!

        Comment


          #5
          Re: How to insert a signature image into an email

          Stan,

          Thanks, this is now showing the image so if we store each of our users images on our own server then the links should work for us. I now need to get the value from the 't.message' memo field into the html brackets, it was using plain text before and worked OK but cannot figure how to code the value of t.message into the body of the email can you please help with this.

          Thanks again

          Michael

          Comment


            #6
            Re: How to insert a signature image into an email

            Just bits and pieces.

            Shown as constructed in the interactive.

            Code:
            [COLOR="#0000FF"]'dummy construction to establish a variable for experimentation
            'your actual code will just use the table field value as at present[/COLOR]
            t.message = "This is a message"+crlf()+"from Michael Humby"
            
            [COLOR="#0000FF"]'see how it looks[/COLOR]
            ? t.message
            = This is a message
            from Michael Humby
            
            [COLOR="#0000FF"]'construct the message.html_message as will be used by email_send2()[/COLOR]
            message.html_message = "<<%html%" + crlf()+ t.message+crlf() + "<img src=\"C:\tempdb\Emailsender\cards.png\">"+crlf()+"%html%"
            
            [COLOR="#0000FF"]'see how it looks[/COLOR]
            ? message.html_message
            = <<%html%
            This is a message
            from Michael Humby
            <img src="C:\tempdb\Emailsender\cards.png">
            %html%
            There can be only one.

            Comment


              #7
              Re: How to insert a signature image into an email

              Were you able to get what you wanted out of this Michael?
              There can be only one.

              Comment


                #8
                Re: How to insert a signature image into an email

                Stan,

                Not had chance to experiment yet, been a bit hectic here. The image is now OK but over the weekend I hope to find time to try your example of interactive code to bring in the user's message together with the image.

                Thanks again

                Michael

                Comment


                  #9
                  Re: How to insert a signature image into an email

                  Stan,

                  I can now send either (A) Plain text message or (B) Signature Image but still cannot get both together see A and B below. I've tried using your suggestion of
                  message.html_message = "<<%html%" + crlf()+ t.message+crlf() + "<img src=\"C:\tempdb\Emailsender\cards.png\">"+crlf()+"%html%"
                  and replaced 't.message' with a character variable holding the value of the memo field holding the message

                  I've also tried switching the memo field to RTF memo using the *bin_to_rtf() function

                  Dim tbl as p
                  dim rtftext as c
                  tbl=table.current()
                  tbl.fetch_first()
                  rtftext.VALUE= *bin_to_rtf(tbl.htmessage)
                  and replacing t.message with the rtftext value i.e.
                  {\rtf1\ansi \deff0{\colortbl;\red0\green0\blue0;}{\fonttbl{\f0\fswiss Tahoma;}}{{\f0 \cf1 \fs16 Dear Jack\par \par This is my rtf message\par \par \par OK\par From Me}}}


                  (A)
                  t=table.current()
                  dim message as P

                  message.message = t.message
                  message.from_alias=t.from
                  If t.attachpath<>"" then
                  message.attachments=rtrim(t.ATTACHPATH)
                  End If
                  message.1related = .t.
                  message.to = t.address
                  message.subject = t.subject
                  'silent, store in mailbox,autowrap all set to false
                  result=email_send2(message, "", .F., .F., .F.)
                  if result=.t. then
                  ui_msg_box("Note","Email sent")
                  ELSE
                  ui_msg_box("Note","Email failed")
                  END
                  End If

                  (B)
                  t=table.current()
                  'the value in t.message is a memo field
                  vv_messagetext=t.message
                  dim message as P

                  message.from_alias=t.from
                  If t.attachpath<>"" then
                  message.attachments=rtrim(t.ATTACHPATH)
                  End If
                  message.1related = .t.
                  message.to = t.address
                  message.subject = t.subject

                  message.html_message = <<%html%

                  This is a message with an image signature but how do I replace this text with the values stored in vv_messagetext variable
                  <br />
                  <br />
                  <img src="http://www.instantnurserymanager.co.uk/dls/cards.png">

                  %html%
                  'silent, store in mailbox and autowrap options all set to false
                  result=email_send2(message, "", .F., .F., .F.)
                  if result=.t. then
                  ui_msg_box("Note","Email sent")
                  ELSE
                  ui_msg_box("Note","Email failed")
                  END
                  End If

                  Michael
                  Last edited by Michael Humby; 03-22-2014, 03:07 PM.

                  Comment


                    #10
                    Re: How to insert a signature image into an email

                    I'm not certain you can use rtf formatting in an html message. You'll probably have to use html formatting.

                    If you just want the message in the table field

                    message.html_message = "<<%html%"+crlf()+ t.message+crlf()+"<br />"+crlf()+"<br />"+crlf()+"<img src="http://www.instantnurserymanager.co.uk/dls/cards.png">"+crlf()+"%html%"
                    Last edited by Stan Mathews; 03-22-2014, 11:19 PM.
                    There can be only one.

                    Comment


                      #11
                      Re: How to insert a signature image into an email

                      Stand,

                      Which type of field do you think the message field should be, Memo or RTFMemo?

                      Michael

                      Comment


                        #12
                        Re: How to insert a signature image into an email

                        If you intend to use the html message with the signature image I would think it would be much easier with a plain memo and adding html formatting.
                        There can be only one.

                        Comment


                          #13
                          Re: How to insert a signature image into an email

                          Stan,

                          Using this line

                          message.html_message = "<<%html%"+crlf()+ RTRIM(vv_messagetext)+crlf()+"<br />"+crlf()+"<br />"+crlf()+"<img src=\"http://www.instantnurserymanager.co.uk/dls/cards.png\">"+crlf()+"%html%"

                          This is what i getWhatiget.png

                          The text is no longer formatted and tags show at beginning and end, any ideas?

                          Michael

                          Comment


                            #14
                            Re: How to insert a signature image into an email

                            Michael I think the best construct is:

                            Code:
                            message.html_message = <<%html%
                            
                             This is a message with an image signature but how do I replace this text with the values stored in vv_messagetext variable
                             <br />
                             <br />
                             <img src="http://www.instantnurserymanager.co.uk/dls/cards.png">
                            %html%
                            to replace the static text you would use:

                            Code:
                            message.html_message = <<%html%
                            
                             aplaceholderfortxt
                             <br />
                             <br />
                             <img src="http://www.instantnurserymanager.co.uk/dls/cards.png">
                            %html%
                             
                            message.html_message = strtran(message.html_message,"aplaceholderfortxt",t.message)'no need for the variable.
                            aplaceholderfortxt can be any thing it just has to be the same in the text & the strtran() function. But not some thing that might be in the text because the function would replace all occurrences of it. You can use the strtran() function to replace as many place holders as you need.
                            Last edited by Allen Klimeck; 03-23-2014, 03:12 PM.

                            Comment


                              #15
                              Re: How to insert a signature image into an email

                              Allen,

                              Thanks, I am nearly there now with this:

                              message.html_message = <<%html%

                              aplaceholderfortxt
                              <br />
                              <br />
                              <img src="http://www.instantnurserymanager.co.uk/dls/cards.png">
                              %html%

                              message.html_message = strtran(message.html_message,"aplaceholderfortxt",t.message)

                              This is the result but I still don't get the layout of the message with spaces and carriage returns Whatiget2.png

                              Thanks

                              Michael

                              Comment

                              Working...
                              X