<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Путь к %windir% при отправке файла на e-mail]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5263&amp;type=atom" />
	<updated>2010-12-08T17:31:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5263</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Путь к %windir% при отправке файла на e-mail]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42716#p42716" />
			<content type="html"><![CDATA[<p>Спасибо огромное <strong>armenxxx1</strong>! Код работает!!! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Спасибо <strong>alexii</strong> за ссылку(буду изучать),замечание - учту!</p>]]></content>
			<author>
				<name><![CDATA[КИРПИЧ]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26502</uri>
			</author>
			<updated>2010-12-08T17:31:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42716#p42716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Путь к %windir% при отправке файла на e-mail]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42715#p42715" />
			<content type="html"><![CDATA[<p><span style="color: Green"><strong>КИРПИЧ</strong>, код на форуме оформляется <a href="http://forum.script-coding.com/help.php#bbcode">тэгом «code»</a>.</span></p><p>Смотрите, например, здесь: <a href="http://www.script-coding.com/WSH/WshShell.html#3.1.">3.1. ExpandEnvironmentStrings</a>.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2010-12-08T17:11:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42715#p42715</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Путь к %windir% при отправке файла на e-mail]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42714#p42714" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Set WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
Const str = &quot;http://schemas.microsoft.com/cdo/configuration/&quot;
With WScript.CreateObject(&quot;CDO.Message&quot;)
.From = &quot;xxx@mail.ru&quot;
.To = &quot;xxx@mail.ru&quot;
.Subject = &quot;xxx&quot;
.Textbody = &quot;xxxxx&quot;
.AddAttachment WSHShell.ExpandEnvironmentStrings(&quot;%windir%\TEST.txt &quot;)
With .Configuration.Fields
.Item(str &amp; &quot;smtpserver&quot;) = &quot;smtp.mail.ru&quot;
.Item(str &amp; &quot;sendusing&quot;) = 2
.Item(str &amp; &quot;smtpserverport&quot;) = 2525
.Item(str &amp; &quot;smtpauthenticate&quot;) = 1
.Item(str &amp; &quot;sendusername&quot;) = &quot;xxx@mail.ru&quot;
.Item(str &amp; &quot;sendpassword&quot;) = &quot;pss&quot; 
.Update
End With  
.Send
End With</code></pre></div>]]></content>
			<author>
				<name><![CDATA[armenxxx1]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26102</uri>
			</author>
			<updated>2010-12-08T17:09:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42714#p42714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: Путь к %windir% при отправке файла на e-mail]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=42713#p42713" />
			<content type="html"><![CDATA[<p>Доброго времени суток! Есть скрипт отправки файла на e-mail. При прописывании пути: iMsg.AddAttachment &quot; C:\WINDOWS\TEST.TXT&quot; - файл отсылается. Хотелось-бы прописать:iMsg.AddAttachment &quot;&nbsp; <strong>%windir%</strong>\TEST.txt </p><p>Код:</p><p>set FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;) <br />Set WSHshell = WScript.CreateObject(&quot;WScript.Shell&quot;) <br />Set sDir = WSHshell.Environment(&quot;Process&quot;) &#039; - находим путь к папке Windows<br />&#039;=================================================&nbsp; &nbsp; ==================================================&nbsp; &nbsp; ============<br />set FSO=createobject(&quot;scripting.filesystemobject&quot;)<br />Call SendPost(&quot;smtp.mail.ru&quot;,&quot;*********77@mail.ru&quot;,&quot;**********ez@mail.ru&quot;,&quot;Инфо&quot;,&quot;**********&quot;)<br />Function SendPost(strSMTP_Server,strTo,strFrom,strSubject,strBody)<br />Set iMsg=CreateObject(&quot;CDO.Message&quot;)<br />Set iConf=CreateObject(&quot;CDO.Configuration&quot;)<br />Set Flds=iConf.Fields<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;)=2<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&quot;)=1<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendusername&quot;)=&quot;*********ez@mail.ru&quot;<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendpassword&quot;)=&quot;*********&quot;<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;)=&quot;smtp.mail.ru&quot;<br />Flds.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;)=25<br />Flds.Update<br />iMsg.Configuration=iConf<br />iMsg.To=strTo<br />iMsg.From=strFrom<br />iMsg.Subject=strSubject<br />iMsg.TextBody=strBody<br />iMsg.AddAttachment &quot; &quot;windir&quot;\TEST.TXT&quot;<br />iMsg.Send<br />End Function<br />Set iMsg=Nothing<br />Set iConf=Nothing<br />Set Flds=Nothing</p><p>Происходит ошибка:<br />Строка: 24<br />Символ: 23<br />Ошибка: Предполагается наличие окончания инструкций<br />код: 80A0401</p><p>P.S. Гуглил,читал, экспериментировал - но победить не смог(в языках программирования полный ноль)</p>]]></content>
			<author>
				<name><![CDATA[КИРПИЧ]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26502</uri>
			</author>
			<updated>2010-12-08T16:48:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=42713#p42713</id>
		</entry>
</feed>
