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

Send With Redemption



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 10th 06, 08:28 AM posted to microsoft.public.outlook.program_vba,microsoft.public.outlook.general
bobdydd
external usenet poster
 
Posts: 17
Default Send With Redemption

Access 2000

I am using the following code to create an email and send it to my
Outlook 2000 Outbox..and everything works OK.

Since I have upgraded to Outlook 2003 there appears to be a set of
apostrophes around the email addresses.......which unless I am barking
up the wrong tree....marks the email as spam and causes my ISP to
reject and not send it.

If I manually type the same address directly into Outlook 2003 ...no
problem. So there must be some security in Outlook 2003 that adds the
apostrophes if another program tries to put and email directly into the
Outbox.

I can put it into the drafts folder........but I don't want to do that

Would the Redemption dll avoid this problem and how do I rewrite the
code below using Redemption.

Thanks for looking

Private Sub CmdEmail_Click()
'Declarations
Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder
Dim MyMail As Outlook.mailItem
Set OL = CreateObject("Outlook.Application")
Set MyMail = OL.CreateItem(olMailItem)
Set OLNS = OL.GetNamespace("MAPI")
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)


'Name Fields
EmailTo = Nz(Me!EmailTo, "") ' email address TO
Subject = Nz(Me!Subject, "") ' the subject of the email
Contents = Nz(Me!Body, "") ' the body of the email

'Prepare Mail
With MyMail
.To = EmailTo
.Subject = Subject
.Body = Body
.Send
End With

'Clean up Code
Exit_He
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub
End Sub

Ads
  #2  
Old July 10th 06, 06:04 PM posted to microsoft.public.outlook.program_vba,microsoft.public.outlook.general
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Send With Redemption

I don"t think I have ever heard of the apostrophes causing an e-maik to be
marked as spam.
Try the following change to see it it helps:

Set OL = CreateObject("Outlook.Application")
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)
OLNS.Logon
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)
Set MyMail = OL.CreateItem(olMailItem)
Set OLNS = OL.GetNamespace("MAPI")

dim sItem As Object
sItem = CreateObject("Redemption.SafeMailItem")
stem.Item = MyMail


'Name Fields
EmailTo = Nz(Me!EmailTo, "") ' email address TO
Subject = Nz(Me!Subject, "") ' the subject of the email
Contents = Nz(Me!Body, "") ' the body of the email

'Prepare stem
With MyMail
.Recipients.AddEx(EmailTo, EmailTo, "SMTP", olTo)
.Subject = Subject
.Body = Body
.Send
End With

'Clean up Code
Exit_He
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub
End Sub


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"bobdydd" wrote in message
ups.com...
Access 2000

I am using the following code to create an email and send it to my
Outlook 2000 Outbox..and everything works OK.

Since I have upgraded to Outlook 2003 there appears to be a set of
apostrophes around the email addresses.......which unless I am barking
up the wrong tree....marks the email as spam and causes my ISP to
reject and not send it.

If I manually type the same address directly into Outlook 2003 ...no
problem. So there must be some security in Outlook 2003 that adds the
apostrophes if another program tries to put and email directly into the
Outbox.

I can put it into the drafts folder........but I don't want to do that

Would the Redemption dll avoid this problem and how do I rewrite the
code below using Redemption.

Thanks for looking

Private Sub CmdEmail_Click()
'Declarations
Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder
Dim MyMail As Outlook.mailItem
Set OL = CreateObject("Outlook.Application")
Set MyMail = OL.CreateItem(olMailItem)
Set OLNS = OL.GetNamespace("MAPI")
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)


'Name Fields
EmailTo = Nz(Me!EmailTo, "") ' email address TO
Subject = Nz(Me!Subject, "") ' the subject of the email
Contents = Nz(Me!Body, "") ' the body of the email

'Prepare Mail
With MyMail
.To = EmailTo
.Subject = Subject
.Body = Body
.Send
End With

'Clean up Code
Exit_He
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub
End Sub



  #3  
Old July 11th 06, 09:05 PM posted to microsoft.public.outlook.program_vba,microsoft.public.outlook.general
bobdydd
external usenet poster
 
Posts: 17
Default Send With Redemption

Thanks for replying Dimitri

I have stripped the code down to basics and it almost works except it
put it in the "drafts" folder instead of the Outbox

Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim MyMail As Redemption.SafeMailItem
Dim OLItem As Object
Dim safeItem As Redemption.SafeMailItem
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder

Set OL = CreateObject("Outlook.Application")
Set OLNS = OL.GetNamespace("MAPI")
Set MyMail = CreateObject("Redemption.SafeMailItem") 'Create
an Instance ofRedemption.SafeMailItem
Set OLItem = OL.CreateItem(0) 'Create a new message oItem
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)


'Prepare Mail
With MyMail
.Item = OLItem
.Recipients.Add ") 'only puts it
in drafts folder
.To = " 'FAULT can't assign vaule
to read only
.Subject = "Test Email"
.Body = "This email needs to go past the Security in
Outlook 2003"
.Send
End With

'Clean up Code
Exit_He
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub

  #4  
Old July 11th 06, 10:32 PM posted to microsoft.public.outlook.program_vba,microsoft.public.outlook.general
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Send With Redemption

You could've used

Set OLItem = OL.Session.GetDefaultFolder(olFolderOutbox).Items. Add

but Outlook would still put it in the Drafts folder. You need to move the
item to Outbox explicitly:

Set OLItem = OL.CreateItem(0)
Set OLItem = OLItem.Move(OL.Session.GetDefaultFolder(olFolderOu tbox))

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"bobdydd" wrote in message
ups.com...
Thanks for replying Dimitri

I have stripped the code down to basics and it almost works except it
put it in the "drafts" folder instead of the Outbox

Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim MyMail As Redemption.SafeMailItem
Dim OLItem As Object
Dim safeItem As Redemption.SafeMailItem
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder

Set OL = CreateObject("Outlook.Application")
Set OLNS = OL.GetNamespace("MAPI")
Set MyMail = CreateObject("Redemption.SafeMailItem") 'Create
an Instance ofRedemption.SafeMailItem
Set OLItem = OL.CreateItem(0) 'Create a new message oItem
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)


'Prepare Mail
With MyMail
.Item = OLItem
.Recipients.Add ") 'only puts it
in drafts folder
.To = " 'FAULT can't assign vaule
to read only
.Subject = "Test Email"
.Body = "This email needs to go past the Security in
Outlook 2003"
.Send
End With

'Clean up Code
Exit_He
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub



 




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
email using redemption Richard Outlook and VBA 10 March 24th 06 08:16 AM
Send email using redemption Richard Outlook - General Queries 3 March 23rd 06 01:44 AM
Outlook Redemption fgibbcollins Outlook and VBA 2 March 16th 06 06:03 PM
Redemption Christoph Add-ins for Outlook 5 March 6th 06 03:26 PM
Crash with Redemption Lars Ibsen Outlook and VBA 4 February 13th 06 05:29 AM


All times are GMT +1. The time now is 12:20 PM.


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.