jtsteffen Posted September 14, 2010 Share Posted September 14, 2010 (edited) Hello I've written some code that automatically creates an e-mail for a person to send into our support people with an unlock code. When I create the e-mail everything looks okay except one thing. At the end of each line there is an extra space that gets added. No matter what I do, I keep getting that space. I want the user to be able to double click on the unlock code and only select the characters. However when they double click on the code now, it selects the unlock code but also selects the space at the end of the line. Anyone know what I'm doing wrong and how to fix this. Thanks #include <INet.au3> Dim $viKey[1][5] ; Create Array for Encryption Info $viKey[0][3]="Program Name" $viKey[0][4]="help@abce.com" Local $vsRegLock="ABCDEFGHIJKLMNOPQRST" _INetMail($viKey[0][4], "Unlock: " & $viKey[0][3], "Please unlock the program requested in the Subject" & @CR _ & @CR & StringLeft($vsRegLock, 20) & @CR & @CR & "Thank you.") ; *** Edited September 14, 2010 by jtsteffen Link to comment Share on other sites More sharing options...
Mat Posted September 14, 2010 Share Posted September 14, 2010 Why are you mixing your EOL (End Of Line) characters like this: "@LF & @CR & @CR"?? That can't be helping anything. AutoIt Project Listing Link to comment Share on other sites More sharing options...
jtsteffen Posted September 14, 2010 Author Share Posted September 14, 2010 Why are you mixing your EOL (End Of Line) characters like this: "@LF & @CR & @CR"?? That can't be helping anything.Part of that was actually me trying to get rid of the space. I am using the @CR to end the line and start typing the message on the next line. Do you have a better way of doing this? Two in a row is suppose to give me a blank line between the text. Link to comment Share on other sites More sharing options...
notsure Posted September 14, 2010 Share Posted September 14, 2010 Have a look at StringStripWS in the help. Link to comment Share on other sites More sharing options...
jtsteffen Posted September 14, 2010 Author Share Posted September 14, 2010 Have a look at StringStripWS in the help.Yep, tried that. It didn't work. I also tried using StringLeft()I suspect it has something to do with adding the @CR in the lines as the first guy mentioned, but I do not know of another way to add a carrage return. Link to comment Share on other sites More sharing options...
notsure Posted September 14, 2010 Share Posted September 14, 2010 Ascii chr 10 and 13. Link to comment Share on other sites More sharing options...
jtsteffen Posted September 14, 2010 Author Share Posted September 14, 2010 Ascii chr 10 and 13. I'm afraid no joy. It is looking like an Outlook thing. It looks like it shows the charage returns as spaces in the message. #include <INet.au3> Dim $viKey[1][5] ; Create Array for Encryption Info $viKey[0][3]="Program Name" $viKey[0][4]="help@abce.com" Local $vsRegLock="ABCDEFGHIJKLMNOPQRST" Local $Message= "Please unlock the program requested in the Subject." & CHR(13) & CHR(13) & $vsRegLock & CHR(13) & CHR(13) & "Thank you." _INetMail($viKey[0][4], "Unlock: " & $viKey[0][3], $Message) Link to comment Share on other sites More sharing options...
autoitter Posted September 14, 2010 Share Posted September 14, 2010 It looks like the mailto handler is adding the spaces at the end of each line. If I call this URL from my browser, then the Thunderbird e-mail client opens and the same thing happens. mailto:abc@test.com?subject=test&body=line1%0D%0Aline2 Probably nothing you can do about it from AutoIt. Maybe you can put the unlock code on the last line of the e-mail? That way not extra spaces are added. Link to comment Share on other sites More sharing options...
jtsteffen Posted September 14, 2010 Author Share Posted September 14, 2010 Good Idea on trying to add it at the end. In this case that would be a okay way to make it work. I would still like to know if anyone has a way to kill it. I did try putting it at the end, but it still added the space. You would think this was an easy thing to fix. Link to comment Share on other sites More sharing options...
czardas Posted September 14, 2010 Share Posted September 14, 2010 This is confusing, but I thought that CR was considered to be a space character. What happens if you replace @CR & @CR with @CRLF? operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Mat Posted September 14, 2010 Share Posted September 14, 2010 This is confusing, but I thought that CR was considered to be a space character. What happens if you replace @CR & @CR with @CRLF?On windows, @CRLF is a linebreak, but in reality it is two characters: @CR & @LFDon't ask why, it seems a stupid way to do it. AutoIt Project Listing Link to comment Share on other sites More sharing options...
RagsRevenge Posted September 14, 2010 Share Posted September 14, 2010 I'm afraid no joy. It is looking like an Outlook thing. It looks like it shows the charage returns as spaces in the message. #include <INet.au3> Dim $viKey[1][5] ; Create Array for Encryption Info $viKey[0][3]="Program Name" $viKey[0][4]="help@abce.com" Local $vsRegLock="ABCDEFGHIJKLMNOPQRST" Local $Message= "Please unlock the program requested in the Subject." & CHR(13) & CHR(13) & $vsRegLock & CHR(13) & CHR(13) & "Thank you." _INetMail($viKey[0][4], "Unlock: " & $viKey[0][3], $Message) Outlook is a disaster area in terms of adding extra spaces/blank lines to text. Outlook also can insert non-standard spaces. Use a hex editor to view the space that stringstripWS isn't removing, and I'll bet it isn't = 20. Stringreplace might work if you find out the hex of the character that is there. I'd be very interested if you find a solution. D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now