Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11823 > unrolled thread
| Started by | andresmartinoe@gmail.com |
|---|---|
| First post | 2018-02-16 01:34 -0800 |
| Last post | 2018-02-17 02:12 +0700 |
| Articles | 10 — 5 participants |
Back to article view | Back to microsoft.public.scripting.vbscript
The second send email is error andresmartinoe@gmail.com - 2018-02-16 01:34 -0800
Re: The second send email is error "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-02-16 11:04 +0100
Re: The second send email is error "R.Wieser" <address@not.available> - 2018-02-16 11:28 +0100
Re: The second send email is error andresmartinoe@gmail.com - 2018-02-16 04:25 -0800
Re: The second send email is error andresmartinoe@gmail.com - 2018-02-16 05:26 -0800
Re: The second send email is error "R.Wieser" <address@not.available> - 2018-02-16 14:38 +0100
Re: The second send email is error entercap.userkeys@gmail.com - 2018-02-16 07:19 -0800
Re: The second send email is error entercap.userkeys@gmail.com - 2018-02-16 10:31 -0800
Re: The second send email is error JJ <jj4public@vfemail.net> - 2018-02-17 02:16 +0700
Re: The second send email is error JJ <jj4public@vfemail.net> - 2018-02-17 02:12 +0700
| From | andresmartinoe@gmail.com |
|---|---|
| Date | 2018-02-16 01:34 -0800 |
| Subject | The second send email is error |
| Message-ID | <aa7ec01d-1d5b-4707-8285-b4bc7212bc14@googlegroups.com> |
Hi All,
The first send email is successfully sent but next send (For Each classes in data) is got error with message is The message could not be send to the SMTP server and bla bla. Please help me and below the script.
Dim data
data = split("C:\data\1.docx,C:\data\2.docx,C:\data\3.docx::C:\data\4.docx,C:\data\5.docx::C:\data\6.docx", "::")
sendNow
Sub sendNow ()
Set eObj = CreateObject("CDO.Message")
For Each classes in data
eObj.From = "test@test.com"
eObj.To = "test@tester.com"
eObj.Subject = hello
eObj.TextBody = hello
'Attach files
files = split(classes, ",")
For Each item in files
eObj.AddAttachment item
Next
Set eConfig = eObj.Configuration
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.tester.com"
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "tester@tester.com"
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "tester"
eConfig.Fields.Update
eObj.Send
End Sub
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2018-02-16 11:04 +0100 |
| Message-ID | <XnsA88B70B82EF0eejj99@194.109.6.166> |
| In reply to | #11823 |
andresmartinoe@gmail.com wrote on 16 Feb 2018 in
microsoft.public.scripting.vbscript:
> Hi All,
>
> The first send email is successfully sent but next send (For Each
> classes in data) is got error with message is The message could not be
> send to the SMTP server and bla bla. Please help me and below the
> script.
>
> Dim data
> data =
> split("C:\data\1.docx,C:\data\2.docx,C:\data\3.docx::C:\data\4.docx,C:\da
> ta\5.docx::C:\data\6.docx", "::") sendNow
>
> Sub sendNow ()
debug = 0
> Set eObj = CreateObject("CDO.Message")
>
> For Each classes in data
debug = debug + 1
response.write "Debugging at 'For Each classes in data': " & n
> eObj.From = "test@test.com"
> eObj.To = "test@tester.com"
> eObj.Subject = hello
> eObj.TextBody = hello
>
> 'Attach files
> files = split(classes, ",")
> For Each item in files
debug = debug + 1
response.write "Debugging at 'For Each item in files': " & n
> eObj.AddAttachment item
> Next
>
> Set eConfig = eObj.Configuration
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpse
> rver") = "smtp.tester.com"
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpse
> rverport") = 465
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendus
> ing") = 2
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpau
> thenticate") = 1
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpus
> essl") = true
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendus
> ername") = "tester@tester.com"
> eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpa
> ssword") = "tester" eConfig.Fields.Update
> eObj.Send
> End Sub
I see two different 'for each',
and only one 'next'!!!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2018-02-16 11:28 +0100 |
| Message-ID | <p66bol$6f2$1@gioia.aioe.org> |
| In reply to | #11823 |
Andres, > Please help me and below the script. That posted script is incomplete: the "For Each classes in data" line does not seem to have a "next" associated to it. As for the problem ? You probably need to put the creation of a message object *inside* the above loop (starting a new message for each data array entry). Hope that helps. Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | andresmartinoe@gmail.com |
|---|---|
| Date | 2018-02-16 04:25 -0800 |
| Message-ID | <460546cf-a1cb-4aa5-95a5-6386d093eb7d@googlegroups.com> |
| In reply to | #11825 |
On Friday, February 16, 2018 at 2:28:41 AM UTC-8, R.Wieser wrote: > Andres, > > > Please help me and below the script. > > That posted script is incomplete: the "For Each classes in data" line does > not seem to have a "next" associated to it. > > As for the problem ? You probably need to put the creation of a message > object *inside* the above loop (starting a new message for each data array > entry). > > Hope that helps. > > Regards, > Rudy Wieser You are correct, I just forget paste "Next" above posted. Please follow the error message screenshoot https://ibb.co/eP2ET7
[toc] | [prev] | [next] | [standalone]
| From | andresmartinoe@gmail.com |
|---|---|
| Date | 2018-02-16 05:26 -0800 |
| Message-ID | <76ed8cd2-eee7-49c8-a7a2-9d5481cf98c5@googlegroups.com> |
| In reply to | #11826 |
On Friday, February 16, 2018 at 4:25:48 AM UTC-8, andresm...@gmail.com wrote: > On Friday, February 16, 2018 at 2:28:41 AM UTC-8, R.Wieser wrote: > > Andres, > > > > > Please help me and below the script. > > > > That posted script is incomplete: the "For Each classes in data" line does > > not seem to have a "next" associated to it. > > > > As for the problem ? You probably need to put the creation of a message > > object *inside* the above loop (starting a new message for each data array > > entry). > > > > Hope that helps. > > > > Regards, > > Rudy Wieser > > You are correct, I just forget paste "Next" above posted. Please follow the error message screenshoot https://ibb.co/eP2ET7 Sorry I forget, for Line 37 is eObj.Send
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2018-02-16 14:38 +0100 |
| Message-ID | <p66msl$qbs$1@gioia.aioe.org> |
| In reply to | #11826 |
Andres, > I just forget paste "Next" above posted. I *think* you need to put a bit more attention to what you're saying: There is no "posted" in your code. Also, I suggested to move the creation of the message object to another spot, and see any indication that you tried. Ignoring suggestions but still expecting help is definitily *not* the way to go. :-( FYI, I removed the addition of attachments and all but the "smtpserver" and "smtpserverport" configuration settings from your script (and set them to a non-SSL SMTP server). All three messages got send (and received). In other words, I cannot help you further (do not have any SSL SMTP set up). Regards, Rudy Wieser P.s. Basic bug-hunting: Remove *everything* from your code thats not absolute neccessary and see if it will work (like I removed the attachments and made the SMTP part as basic as possible). If it than does work start adding stuff bit-by-bit until you again get an error. The problem is than most likely in the last-added part.
[toc] | [prev] | [next] | [standalone]
| From | entercap.userkeys@gmail.com |
|---|---|
| Date | 2018-02-16 07:19 -0800 |
| Message-ID | <931dd325-8057-490f-8c9f-24a1b3612c7d@googlegroups.com> |
| In reply to | #11828 |
Hi Rudy,
I am sorry, I am still dont understand whats exactly you mean. I mean incomplete posting like forget "Next". Iwas try put the debug but the debug is error. I am a beginner in VBS. Please correct my script please.
Dim data
data = split("C:\data\1.docx,C:\data\2.docx,C:\data\3.docx::C:\data\4.docx,C:\data\5.docx::C:\data\6.docx", "::")
sendNow
Sub sendNow ()
Set eObj = CreateObject("CDO.Message")
For Each classes in data
eObj.From = "tester@test.com"
eObj.To = "test@tester.com"
eObj.Subject = hello
eObj.TextBody = hello
'Attach files
files = split(classes, ",")
For Each item in files
eObj.AddAttachment item
Next
Set eConfig = eObj.Configuration
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "tester@gmail.com"
eConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "tester"
eConfig.Fields.Update
eObj.Send 'Here is the problem n=1 is work but next n is error. n (from For Each classes in data)
Next
End Sub
Thanks in advance!
[toc] | [prev] | [next] | [standalone]
| From | entercap.userkeys@gmail.com |
|---|---|
| Date | 2018-02-16 10:31 -0800 |
| Message-ID | <84018253-7f87-474e-9262-53b910e8e427@googlegroups.com> |
| In reply to | #11830 |
I am able to send a file of 10kb but unable to send 200kb file. So, I got the problem is the attachment file size limit for SMTP server (smtp.gmail.com). Anyone idea for this please. Thank you
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2018-02-17 02:16 +0700 |
| Message-ID | <185eniqlavjy5$.qulteaoyzhgz.dlg@40tude.net> |
| In reply to | #11831 |
On Fri, 16 Feb 2018 10:31:10 -0800 (PST), entercap.userkeys@gmail.com wrote: > I am able to send a file of 10kb but unable to send 200kb file. > So, I got the problem is the attachment file size limit for SMTP server > (smtp.gmail.com). Anyone idea for this please. > > Thank you It's not about attachment size, in this case. GMail's limit of attachment size is 25MB. If an attachment size or the total size of all attachments is greater than 25MB, GMail will move them into Google Drive and convert the attachments into links. However, IIRC, if a Google user never accessed the Google Drive service, GMail might reject the email.
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2018-02-17 02:12 +0700 |
| Message-ID | <74h4vloan1cx.7ej0wpl3xrbz$.dlg@40tude.net> |
| In reply to | #11823 |
On Fri, 16 Feb 2018 01:34:51 -0800 (PST), andresmartinoe@gmail.com wrote: > Hi All, > > The first send email is successfully sent but next send (For Each classes > in data) is got error with message is The message could not be send to > the SMTP server and bla bla. Please help me and below the script. [snip] First of all, a programmer should **never** ignore an error message. As stated on the error message screenshot which you later posted, it says "...message content and attachment content guildlines". It means that GMail rejected your email because one or more of your attachments' or message contents. Chances are that the attached document(s) contains a macro which triggers GMail's anti virus.
[toc] | [prev] | [standalone]
Back to top | Article view | microsoft.public.scripting.vbscript
csiph-web