By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,140 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,140 IT Pros & Developers. It's quick & easy.

Is it a safe assumption? - email addresses duplicates automatically deleted

P: n/a
I have a string of email addresses with duplicates. like

"ab*@abc.com; cd*@cde.com; ab*@abc.com"

If I use this string with sendobject, the receiver will get it only once
which is perfect to me. I wonder if it will be the case with other mail
applications than Outlook Express. TIA

(BTW if somebody has code to delete duplicates in a string like this, it
would be appreciated.)

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You should make sure that the level at which the duplication is ignored is
actually that of the sending application (OE) and not that of the outgoing
mail server (IMAP or SMTP?). It might be that OE *is* sending the duplicate
addresses on to the mailserver, which is then set to ignore them. In that
case (1) it wouldn't matter what email application was being used (2) it
might matter if your application were to be used on a different system,
routing mail through a different server.

HTH,
Bruce Rusl

"Saintor" <sa******@REMOVETHIShotmail.com> wrote in message
news:0p********************@weber.videotron.net...
I have a string of email addresses with duplicates. like

"ab*@abc.com; cd*@cde.com; ab*@abc.com"

If I use this string with sendobject, the receiver will get it only once
which is perfect to me. I wonder if it will be the case with other mail
applications than Outlook Express. TIA

(BTW if somebody has code to delete duplicates in a string like this, it
would be appreciated.)

Nov 12 '05 #2

P: n/a
On Sun, 21 Sep 2003 17:05:42 -0400 in comp.databases.ms-access,
"Saintor" <sa******@REMOVETHIShotmail.com> wrote:
I have a string of email addresses with duplicates. like

"ab*@abc.com; cd*@cde.com; ab*@abc.com"

If I use this string with sendobject, the receiver will get it only once
which is perfect to me. I wonder if it will be the case with other mail
applications than Outlook Express. TIA

(BTW if somebody has code to delete duplicates in a string like this, it
would be appreciated.)


Where did the string come from? If from a table then surely the
duplicates could be filtered out first?

If not then...
The StrTok function below came as an example from Basic MS-PDS 7.1, I
can't remember what the varDummy bit was for (I might have added that
later for some reason, serves me right for not commenting it). You can
use that in the following code that youi'll have to modify to suit
your needs.

Sub DelDupeAddy()
Dim strAddy As String
Dim strTemp As String
Dim strDeDupe As String

strAddy = "ab*@abc.com; cd*@cde.com; ab*@abc.com; x@x.com;
y@y.com; x@x.com"

' totally enclose each addy with ";" so we don't confuse
' a@a.com with aa@a.com later on
strDeDupe = ";"
strTemp = Trim(Strtok(strAddy, ";"))
Do While Len(strTemp)
If InStr(1, strDeDupe, ";" & strTemp & ";") = 0 Then
strDeDupe = strDeDupe & strTemp & ";"
End If
strTemp = Strtok("", ";")
Loop
' strip leading and trailing ; and put spaces back
strDeDupe = Replace(Mid(strDeDupe, 2, Len(strDeDupe) - 2), ";", ";
")
Debug.Print strDeDupe
End Sub


Function Strtok(pstrSrce As Variant, strDelim As String, Optional
varDummy As Variant) As Variant
Static intstart As Integer, strSaveStr As String

Dim intBegPos As Integer, intEndPos As Integer
Dim intLn As Integer

On Error GoTo StrTokError
' If first call, make a copy of the string.
If pstrSrce <> "" Then
intstart = 1: strSaveStr = pstrSrce
End If

intBegPos = intstart
intLn = Len(strSaveStr)
' Look for start of a token (character that isn't delimiter).
Do While intBegPos <= intLn And InStr(strDelim, Mid(strSaveStr,
intBegPos, 1)) <> 0
intBegPos = intBegPos + 1
Loop
' Test for token start found.
If intBegPos > intLn Then
Strtok = ""
Exit Function
End If
' Find the end of the token.
intEndPos = intBegPos
Do While intEndPos <= intLn And InStr(strDelim, Mid(strSaveStr,
intEndPos, 1)) = 0
intEndPos = intEndPos + 1
Loop
Strtok = Trim(Mid(strSaveStr, intBegPos, intEndPos - intBegPos))

If IsNull(pstrSrce) Then
Strtok = Null
End If

' Set starting point for search for next token.
intstart = intEndPos

StrTokExit:
Exit Function
StrTokError:
Resume StrTokExit

End Function

--
A)bort, R)etry, I)nfluence with large hammer.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.