<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Отправка письма с вложениями]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10599&amp;type=atom" />
	<updated>2015-04-27T09:57:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10599</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Отправка письма с вложениями]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93637#p93637" />
			<content type="html"><![CDATA[<p>Данный скрипт просто открывает в IE страницу на gmail с твоей почтой, находит элементы на странице по их именам, вставляет в них текст и нажимает кнопку Отправить. Но стоит веб-мастерам gmail хоть чуть-чуть поправить код (а они его правят регулярно) и этот скрипт потеряет работоспособность. А вложение тут цепляется через &lt;input type=&quot;file&quot;&gt; в который автоматом имя нужного файла не вставишь (безопасность, мать ее...)...<br />Короче, у меня такое предложение - забить на этот скрипт и пользоваться <a href="http://forum.script-coding.com/viewtopic.php?id=7232">нормальными решениями</a>.</p>]]></content>
			<author>
				<name><![CDATA[mozers]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=4112</uri>
			</author>
			<updated>2015-04-27T09:57:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93637#p93637</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: Отправка письма с вложениями]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=93592#p93592" />
			<content type="html"><![CDATA[<p>Есть вот такой скрипт создания письма. Подскажите, как к письму прикрепить файлы.<br /><a href="http://www.webdeveloper.com/forum/showthread.php?300543-How-does-gmail-attach-file-work">ссылка </a>вроде по теме<br /></p><div class="codebox"><pre><code>WScript.Quit Main

Function Main
  Set objShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
  Set IE = WScript.CreateObject(&quot;InternetExplorer.Application&quot;, &quot;IE_&quot;)
  IE.Visible = True
  objShell.AppActivate IE
  Resolution = Screen_Resolution()
  Width =  Resolution(0)
  Hight=  Resolution(1)
  IE.Top = 0
  IE.Left = 300
  IE.Width = 1000
  IE.Height = 1170
  IE.Visible = 1
  IE.AddressBar = 0
  IE.Navigate &quot;https://mail.google.com/mail/u/0/?view=cm&amp;fs=1&quot;
&#039;&amp;to=someone@example.com&amp;su=МАКЕТ&amp;body=BODY LINE1%0aBODY LINE2&amp;bcc=someone.else@example.com&amp;tf=1
  Wait IE
  With IE.Document
    .getElementByID(&quot;:om&quot;).value = &quot;&quot; &#039;Кому
    .getElementByID(&quot;:p1&quot;).value = &quot;&quot; &#039;ТЕМА
    &#039;.getElementByID(&quot;gaia_loginform&quot;).submit
&#039;    .getElementsByClassName(&quot;a1 aaA aMZ&quot;).value = &quot;D:\data.txt&quot;
&#039;    .getElementById(&quot;:oi&quot;).value = &quot;D:\data.txt&quot;
&#039;    .getElementsByClassName(&quot;a1 aaA aMZ&quot;)(0).submit()


  End With
End Function

Sub Wait(IE)
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState &lt; 4 And IE.Busy
  Do
    WScript.Sleep 500
  Loop While IE.ReadyState &lt; 4 And IE.Busy
End Sub

Sub IE_OnQuit
  On Error Resume Next
  WScript.StdErr.WriteLine &quot;IE closed before script finished.&quot;
  WScript.Quit
End Sub

Function Screen_Resolution()
Dim MyArray(1)
    Set objWMIService = GetObject(&quot;Winmgmts:\\.\root\cimv2&quot;)
    Set colItems = objWMIService.ExecQuery(&quot;Select * From Win32_DesktopMonitor where DeviceID = &#039;DesktopMonitor1&#039;&quot;,,0)
    For Each objItem in colItems
        intHorizontal = objItem.ScreenWidth
        intVertical = objItem.ScreenHeight
    Next
MyArray(0) = intHorizontal
MyArray(1) = intVertical
Screen_Resolution = MyArray

End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[929151]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29475</uri>
			</author>
			<updated>2015-04-25T04:01:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=93592#p93592</id>
		</entry>
</feed>
