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

Garbled email

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

    Garbled email

    I have a system that generates numerous PDF files and then sends each to specified recipients. The process usually works properly, but occasionally, one of the emails comes out completely garbled. It is as though something hiccuped during the email send process.

    This is what gets sent:
    Sent: Thursday, December 17, 2009 6:09 AM
    To: [email protected]
    Subject: Tobyhanna PA Pavement Condition Forcast

    ----=_C811abB4F6e6051E3705EEeb36BB0320F45bC2637a54D36b3332a32B0D62C6E0
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: 7bit

    Attached is the Pavement Condition Forcast for Tobyhanna PA



    ----=_C811abB4F6e6051E3705EEeb36BB0320F45bC2637a54D36b3332a32B0D62C6E0
    Content-Type: application/pdf; name="Tobyhanna_PA_Pavement_forcast.pdf"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="Tobyhanna_PA_Pavement_forcast.pdf"

    JVBERi0xLjMNJf////8NMSAwIG9iag08PA0vVGl0bGUgKP7/AEMAbwBuAGQAaQB0AGkAbwBu
    ACAATABlAHQAdABlAHIAcykNL1Byb2R1Y2VyIChBbXl1bmkgUERGIENvbnZlcnRlciB2ZXJz
    aW9uIDIuNTEtYikNL0NyZWF0aW9uRGF0ZSAoRDoyMDA5MTIxNzA1MzA0MykNPj4NZW5kb2Jq
    DTcgMCBvYmoNPDwgL0xlbmd0aCA4IDAgUiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+Pg1zdHJl
    YW0KeF4zVDAAQkMFQzM9CyAjOZe3kDePy9jCWM/cDCxlbqRgYalnYKJgBhFLzuXS98y1VHDJ
    The encoding mess goes on for quite a while, I just clipped a small sample.
    It is not always with the same pdf file, it is not always to the same recipient.

    The PDF's are all OK, and it just seems to be in the e-mail process.
    This process runs automatically 4 times daily, and it really needs to be correct. It is making my customer rather nervous that the process isn't working 100% correctly.

    Here is the routine that I use to build the PDF's and then mail them. Each report is built and saved to a specified folder, then I loop through a "client" table to send the appropriate PDF to the corresponding e-mail address.
    I needed to put timing delays into the email routine so that the ISP didn't think I was spamming.
    Code:
    Dim text1 as C
    Dim a1[4] as C
    dim L as N
    dim M as N
    dim N as N
    Dim Skip as N
    text1 = get_from_file("C:\FORECAST\timing.txt")
    a1.initialize(text1)
    N = val(a1[1]) 'N is the number of e-mails to do in a batch
    L = val(a1[2]) 'L is the number of seconds to wait after each e-mail
    M = val(a1[3]) 'M is the number of seconds to wait between batches
    Skip = val(a1[4]) 'SKIP is the number of e-mails that had been sent in a previous attempt.
    
    ON ERROR goto ERROR_TEST  'usual error is SMTP timeout.  Wait 90 seconds and try again
    
    dim tbl as P
    Dim tbl2 as P
    tbl = table.open("conditions")
    tbl2 = table.open("clients")
    'goto skipit2
    f1.write_line("Begin Build of Reports at "+time("h:mmAM")+" on "+date_format(date(),"Mon-d-yyyy"))
    
    dim J as N
    Dim loc as C
    J=0
    loc = ""
    
    tbl.fetch_first()
    loc = tbl.Location
    while .not.tbl.fetch_eof()
    	if exist(padr(trim(tbl.Location),35," "),"conditions","Location")
    		pdf_filename = "C:\Forecast\reports"+chr(92)+trim(tbl.location)+"_Pavement_forcast.pdf"
    		if file_exists(pdf_filename)
    			file_remove(pdf_filename)
    		end if
    		filt1 = "location="+quote(trim(tbl.Location))
    		query.filter = filt1
    		query.order = ""
    		'report.preview("Condition Letters",query.filter,query.order)
    		report.SaveAs("Condition Letters","PDF",query.filter,query.order,pdf_filename)
    	end if		
    	tbl.fetch_next()
    	while tbl.Location = loc .and..not.tbl.eof()
    		tbl.fetch_next()
    	end while
    	loc = tbl.Location
    	J=J+1
    end while
    
    f1.write_line(alltrim(str(J-1))+" Reports Built by "+time("h:mmAM")+" on "+date_format(date(),"Mon-d-yyyy"))
    skipit2:
    
    f1.write_line("Begin E-mail of Reports at "+time("h:mmAM")+" on "+date_format(date(),"Mon-d-yyyy"))
    tbl2.index_primary_put("Location")
    tbl2.fetch_first()
    dim I as N
    dim K as N
    J=0
    K=0
    I=0
    h = 0
    'skip anty locations with a blank e-mail address.  Skip the 1st [skip] reports
    while .not.tbl2.fetch_eof()
    	if tbl2.Email_addr = ""
    		statusbar.Set_Text("skipping email report "+strtran(trim(tbl2.location),"_"," "))
    		tbl2.fetch_next()
    	  else
    		if Skip >0
    			while h < Skip
    				tbl2.fetch_next()
    				h = h+1
    			end while
    		end if
    		if I < N 
    			J=J+1
    			I=I+1
    			pdf_filename = "C:\Forecast\reports"+chr(92)+trim(tbl2.location)+"_Pavement_forcast.pdf"
    			msg_text = "Attached is the Pavement Condition Forcast for "+strtran(tbl2.location,"_"," ")
    			param_to = trim(tbl2.Email_addr)
    			param_subject = alltrim(strtran(tbl2.location,"_"," "))+" Pavement Condition Forcast"
    			param_cc = ""
    			param_bcc = ""
    			param_msg = msg_text
    			param_attachments = pdf_filename
    	'		traceln(alltrim(str(K+I))+" sending email report "+strtran(trim(tbl1.location),"_"," ")+" to "+trim(tbl1.Email_addr))
    			statusbar.Set_Text(alltrim(str(K+I))+" sending email report "+strtran(trim(tbl2.location),"_"," ")+" to "+trim(tbl2.Email_addr))
    			email_Send(param_to,param_subject,param_msg,param_attachments)
    			tbl2.fetch_next()
    			sleep(L)
    		  else
    			statusbar.Set_Text("Sleeping for "+alltrim(str(M/60,5,2))+" minutes... DO NOT Disturb!")
    	  		sleep(M)
    			I=0
    			K=K+N
    			'tbl1.fetch_next()
    		end if
    	end if
    end while
    f1.write_line(alltrim(str(J))+" Reports Mailed by "+time("h:mmAM")+" on "+date_format(date(),"Mon-d-yyyy"))
    f1.write_line("*** End Build and e-mail of Reports at "+time("h:mmAM")+" on "+date_format(date(),"Mon-d-yyyy"))
    
    tbl2.close()
    tbl.close()
    
    endit:
    f1.close()
    f1.flush()
    
    'end
    a5.Close()
    
    ERROR_TEST:
    	'wait for 90 seconds and then try the send again
    	SLEEP(90)
    	RESUME 0
    end
    Is it Alpha, or the ISP?

    If anyone has an idea, please let me know.

    Thanks,

    Tom
    Last edited by Tom Henkel; 12-17-2009, 11:50 AM. Reason: If only I could Type!

    #2
    Re: Garbled email

    Originally posted by Tom Henkel View Post
    Is it Alpha, or the ISP?
    Safe guess: alpha.
    alpha used to parse long lines by inserting a hard return ( I believe after 65 characters). That was a problem with long URL's and was corrected but maybe it is still a problem with long file names which leads to the garbled stuff.

    Comment


      #3
      Re: Garbled email

      What is being sent is a base64 encoded MIME message. This is the standard way of transporting attachments in email. The "garbled" look is the encoding, and the Content-Type, etc is the MIME formatting.

      Tom, do you have the full headers of one of theses messages available? From what you have posted, it looks like the message itself is correctly formatted and transmitted, but a missing or incorrect header could potentially cause the email reader to not display it properly.

      Lenny Forziati
      Vice President, Internet Products and Technical Services
      Alpha Software Corporation

      Comment

      Working...
      X