A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Get smtp address on send



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old February 13th 08, 04:27 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Get smtp address on send

I don't anywhere in that code where you actually add any recipients to the
message. Add at least one recipient and save the item then get it as a
SafeMailItem object. Try that and see if it helps.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"dkgb" wrote in message
...
I'm still struggling with this. Here is a code snippet. The comments
detail
the the issues I am having with addressentry and SMTPAddress:

Function FileSendingEmail(MyMail As Object)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim SafeMail
Dim SMTPAddress

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set SafeMail = CreateObject("Redemption.SafemailItem")
SafeMail.item = myMail

SMTPAddress = SafeMail.Recipients(1).AddressEntry.SMTPAddress
‘Error “Index must be between 1 and count”

SMTPAddress = SafeMail.item.Recipients(1).AddressEntry.SMTPAddre ss
‘Generates security warning then error “object does not support this
property or method”


MsgBox SMTPAddress

End function


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get SMTP address of contact that shares email address of an Exchange user Jeff Outlook and VBA 14 January 15th 09 01:50 AM
can't send mail, address mangled to "=SMTP:" d d Outlook - General Queries 1 November 20th 06 10:47 AM
޷ҵSMTPķǷȷ ʻ: 'POP3', : 'SMTP', Э: SMTP, ˿: 25, ȫ(SSL): , ׽ִ: 11001, : 0x800CCC0D John Smith Outlook Express 0 September 5th 06 02:15 AM
޷ҵsmtpķǷȷ ʻ: 'pop3', : 'smtp', Э: SMTP, ˿: 25, ȫ(SSL): , ׽ִ: 11001, : 0x800CCC0D Outlook Express 0 June 17th 06 10:44 AM
need to send rtf format using smtp and vb6 or vb.net aharbour Outlook and VBA 1 February 21st 06 02:56 PM


All times are GMT +1. The time now is 09:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright 2004-2025 Outlook Banter.
The comments are property of their posters.