🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2016

TClientSocket::LocalAddress

#2016
From: Robert G. Hoover
Date: Thu, 10 May 2007 16:29
29 lines
1936 bytes
Hi,

I'm using a TClientSocket to connect to my company's SMTP server to send an
automated email message (for internal use only - NOT SPAM) over port 25. I'm
identifying myself to the server as Socket->LocalHost

ehlo [192.168.0.109]

which seems to work on my laptop where LocalAddress = 192.168.0.109 and does not
work on my desktop where LocalAddress = 127.0.0.1. Neither of these is ideal as
I think the SMTP server wants my "worldview" IP address which is something like
109.76.35.22. How can I determine my actual IP address from inside this
TClientSocket object?

Thanks,

Rob


---------------------------------------------------

// compile message
AnsiString MessageContents = "ehlo ["     + Socket->LocalAddress + "]\n"
			   + "mail from:" + EmailSender->Text    + "\n"
			   + "rcpt to:"   + EmailRecipient->Text + "\n"
			   + "data\n"
			   + "from:"      + EmailFrom->Text      + "\n"
			   + "to:"        + EmailTo->Text        + "\n"
			   + "subject:"   + EmailSubject->Text   + "\n";
Technical Details
Message-ID: <46434854$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a04762d1675e9ed3,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 10 May 2007 12:29:07 -0400
From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry>
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: TClientSocket::LocalAddress
X-Enigmail-Version: 0.94.1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 000739-1, 05/10/2007), Outbound message
X-Antivirus-Status: Not-Tested
NNTP-Posting-Host: 76.106.54.160
Message-ID: <46434854$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1178814548 76.106.54.160 (10 May 2007 09:29:08 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail