<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBA: отправка e-mail через proxy]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8029</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8029&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBA: отправка e-mail через proxy».]]></description>
		<lastBuildDate>Sat, 02 Feb 2013 12:42:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[VBA: отправка e-mail через proxy]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69037#p69037</link>
			<description><![CDATA[<p>Добрый день,<br />Подскажите пожалуйста как отправить e-mail через прокси<br />Я делал вот так:<br /></p><div class="codebox"><pre><code>
Option Explicit
 
Sub Send_Mail()
    Const CDO_Cnf = &quot;http://schemas.microsoft.com/cdo/configuration/&quot;
    Dim oCDOCnf As Object, oCDOMsg As Object
    Dim SMTPserver As String, sUsername As String, sPass As String, sMsg As String, proxy As String
    Dim sTo As String, sFrom As String, sSubject As String, sBody As String, sAttachment As String
    On Error Resume Next
    SMTPserver = &quot;smtp.bk.ru&quot;   
    sUsername = &quot;user@bk.ru&quot;   
    sPass = &quot;password&quot;  
    proxy = &quot;107.7.144.62:80&quot;
    If Len(SMTPserver) = 0 Then MsgBox &quot;Не указан SMTP сервер&quot;, vbInformation, &quot;email vba&quot;: Exit Sub
    If Len(sUsername) = 0 Then MsgBox &quot;Не указана учетная запись&quot;, vbInformation, &quot;email vba&quot;: Exit Sub
    If Len(sPass) = 0 Then MsgBox &quot;Не указан пароль&quot;, vbInformation, &quot;email vba&quot;: Exit Sub
 
    sTo = &quot;tosend@yandex.ru&quot;  
    sFrom = &quot;user@bk.ru&quot;   
    sSubject = &quot;TEST&quot;  
    sBody = &quot;Привет от TEST&quot;  
  
    Set oCDOCnf = CreateObject(&quot;CDO.Configuration&quot;)
 
    With oCDOCnf.Fields
        .Item(&quot;http://schemas.microsoft.com/cdo/configuration/urlproxyserver&quot;).Value = proxy
        .Item(CDO_Cnf &amp; &quot;sendusing&quot;) = 2
        .Item(CDO_Cnf &amp; &quot;smtpauthenticate&quot;) = 1
        .Item(CDO_Cnf &amp; &quot;smtpserver&quot;) = SMTPserver
        .Item(CDO_Cnf &amp; &quot;sendusername&quot;) = sUsername
        .Item(CDO_Cnf &amp; &quot;sendpassword&quot;) = sPass
        .Update
    End With
 
    Set oCDOMsg = CreateObject(&quot;CDO.Message&quot;)
        With oCDOMsg
        Set .Configuration = oCDOCnf
        .BodyPart.Charset = &quot;koi8-r&quot;
        .From = sFrom
        .To = sTo
        .Subject = sSubject
        .TextBody = sBody
        If Len(sAttachment) &gt; 0 Then .AddAttachment sAttachment
        .Send
    End With
</code></pre></div><p>Сообщение отправляется, но почему то не через прокси, в теле письма все равно вижу ip и имя пользователя моего компьютера. Подскажите пожалуйста как быть?</p>]]></description>
			<author><![CDATA[null@example.com (bolahg)]]></author>
			<pubDate>Sat, 02 Feb 2013 12:42:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69037#p69037</guid>
		</item>
	</channel>
</rss>
