vbscript email message lenght limits?

5 pts.
Tags:
VBScript
VBScript Email
Is there a "total message length" limitation for Excel Macro Emails? I'm new to vbscripting and thought I had successfully created code to email Excel data via a macro. I have written the macro to send up to 30 lines of information, but have discovered that the number of lines I can actually send depends on the amount of data within the lines themselves. I.E. I can send 30 lines with a small amounts of data per line or perhaps only 12 lines of data with larger amounts of data per line. My code (below) works, provided the amount of data in any or all of the lines is is not "too large." If is is "too large," it simply does not send the email. Any sugestions? Code: ' SendEmail Macro ' Email Data ' ' Keyboard Shortcut: Ctrl+r ' Private Declare Function ShellExecute Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Sub SendEmail() Dim Email As String, Subj As String Dim Msg As String, URL As String Dim r As Integer, x As Double Sheets("email").Select ' Get the email address Email = "first.last@company.com" ' Message subject Subj = "Project Time Sheet: " Subj = Subj & Cells(2, 2) Subj = Subj & " for Period " Subj = Subj & Cells(2, 4) Subj = Subj & " - " Subj = Subj & Cells(2, 5) ' Compose the message Msg = "" Msg = Msg & Cells(33, 2) & vbCrLf Msg = Msg & Cells(34, 2) & vbCrLf Msg = Msg & Cells(35, 2) & vbCrLf Msg = Msg & Cells(36, 2) & vbCrLf Msg = Msg & Cells(37, 2) & vbCrLf Msg = Msg & Cells(38, 2) & vbCrLf Msg = Msg & Cells(39, 2) & vbCrLf Msg = Msg & Cells(40, 2) & vbCrLf Msg = Msg & Cells(41, 2) & vbCrLf Msg = Msg & Cells(42, 2) & vbCrLf Msg = Msg & Cells(43, 2) & vbCrLf Msg = Msg & Cells(44, 2) & vbCrLf Msg = Msg & Cells(45, 2) & vbCrLf Msg = Msg & Cells(46, 2) & vbCrLf Msg = Msg & Cells(47, 2) & vbCrLf Msg = Msg & Cells(48, 2) & vbCrLf Msg = Msg & Cells(49, 2) & vbCrLf Msg = Msg & Cells(50, 2) & vbCrLf Msg = Msg & Cells(51, 2) & vbCrLf Msg = Msg & Cells(52, 2) & vbCrLf Msg = Msg & Cells(53, 2) & vbCrLf Msg = Msg & Cells(54, 2) & vbCrLf Msg = Msg & Cells(55, 2) & vbCrLf Msg = Msg & Cells(56, 2) & vbCrLf Msg = Msg & Cells(57, 2) & vbCrLf Msg = Msg & Cells(58, 2) & vbCrLf Msg = Msg & Cells(59, 2) & vbCrLf Msg = Msg & Cells(60, 2) & vbCrLf Msg = Msg & Cells(61, 2) & vbCrLf Msg = Msg & Cells(62, 2) & vbCrLf ' Replace spaces with %20 (hex) 'Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20") 'Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20") ' Replace carriage returns with %0D%0A (hex) Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A") ' Create the URL URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg ' Execute the URL (start the email client) ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus ' Wait two seconds before sending keystrokes Application.Wait (Now + TimeValue("0:00:02")) Application.SendKeys "%s" Sheets("Weekly Report").Select End Sub

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following