Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,792| Members 17,821, Newest cdotkhn| Online 268
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » Information Technology » Send mail in Office XP WITHOUT warnings: the 99% solution

Send mail in Office XP WITHOUT warnings: the 99% solution

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
I would like to know how can I send my document via e-mail w/ tem veronica Information Technology 1 28-Jul-2006 08:27 AM
how do i block my e-mail addres when i send mail hannah Information Technology 1 28-Jul-2006 08:25 AM
how to send a link by e-mail from the site I am using W. Blue Information Technology 1 28-Jul-2006 08:14 AM
How to send on an E-Mail ??? Dorchmike Information Technology 1 28-Jul-2006 08:10 AM
how do i send and receive faxes from my fax using office word or w confused Information Technology 1 28-Oct-2005 18:00 PM


Tags
99%, mail, office, send, solution, warnings, without
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:03 AM
serviceman via AccessMonster.com's Avatar serviceman via AccessMonster.com
Guest
 
Posts: n/a
   
   
Send mail in Office XP WITHOUT warnings: the 99% solution

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Ok gang,
I've been getting wonderful advice and tips from this site, and now I have
something to give back (maybe!):
The following script to send a single email was found on an MSDN tech page,
but for the life of me I can't find the link (damned that delete history
button! I added the loop portion and changed the file lookup for
attachments a bit.
The following code will loop through a query and send an email to each email
address WITHOUT ANY SECURITY WARNINGS. This apparently works only with Office
XP...

HOWEVER.... (Knew that was coming, right?)
The script relies on the dreaded sendkeys command to send each email, and of
course it is a bit Kludgey...
The only issues I've seen with this script is the sendkey problems below:
1) Sendkeys absolutely hates Word as the editor. It will work 1 in 10 times.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9522-send-mail-office-xp-without-warnings.html
2) When outlook is not using Word as the editor, all but the last email seem
to send 90% of the time, and the other 10% of the time it works fine. Why it
doesn't send the keystrokes to the last email is beyond me.

If anyone can come up with a fix for the sendkey portion, This will probably
be a very useful piece of code!

This is written using ADODB (we're on SQL server) but can use DAO recordset
as well. At present I have a form with text fields for subject,message, and
file path to attach that I pass in, and the email addresses are passed in
from the 1st query column (rs(0)).

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Dim rs As ADODB.Recordset
' are not empty or null>
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM WHERE ",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With rs

Do Until rs.EOF


Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)

EmailAddr = rs(0)
'CopyEmailAddr =
Subj =
Body =
PathName =

With objMail
.To = EmailAddr
.cc = CopyEmailAddr
.Subject = Subj
.Body = Body
.NoAging = True
If IsNull(PathName) = False Then
.Attachments.Add PathName
End If
.Display
End With
'Here is the problem area
SendKeys "%{s}", True 'send the email without prompts
'End of problem area
rs.MoveNext

Loop

Set objMail = Nothing
Set objOutlook = Nothing
End With
Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
'
MsgBox Err.Description
End If
Resume Exit_Command0_Click

End Sub

If anyone can add to this, post it here so we can all benefit (me too!).

Andy

--
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via http://www.accessmonster.com





 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:03 AM
schasteen's Avatar schasteen
Guest
 
Posts: n/a
   
   
RE: Send mail in Office XP WITHOUT warnings: the 99% solution

This is a way to avoid outlook and the sendkey and uses cdo. There are
limitations with operating systems. I know XP is OK, but I forget the rest
off the top of my head. Microsoft has more information about using this
method.

Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String


strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "ExchangeServerName"

.Item(strSch & "SMTPAuthenticate") = cdoBasic
.Item(strSch & "SendUserName") = "User@domain.com"
.Item(strSch & "SendPassword") = "AccountPassword"
.Update
End With


Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "User"
.Sender = "User"
.To = SendTo
.Cc = SendCc
.Subject = SendSubject
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
.TextBody = SendBody
If Len(SendAttachment) > 0 Then
.AddAttachment SendAttachment
End If
.Send
End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing

"serviceman via AccessMonster.com" wrote:

> Ok gang,
> I've been getting wonderful advice and tips from this site, and now I have
> something to give back (maybe!):
> The following script to send a single email was found on an MSDN tech page,
> but for the life of me I can't find the link (damned that delete history
> button! I added the loop portion and changed the file lookup for
> attachments a bit.
> The following code will loop through a query and send an email to each email
> address WITHOUT ANY SECURITY WARNINGS. This apparently works only with Office
> XP...
>
> HOWEVER.... (Knew that was coming, right?)
> The script relies on the dreaded sendkeys command to send each email, and of
> course it is a bit Kludgey...
> The only issues I've seen with this script is the sendkey problems below:
> 1) Sendkeys absolutely hates Word as the editor. It will work 1 in 10 times.
> 2) When outlook is not using Word as the editor, all but the last email seem
> to send 90% of the time, and the other 10% of the time it works fine. Why it
> doesn't send the keystrokes to the last email is beyond me.
>
> If anyone can come up with a fix for the sendkey portion, This will probably
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
> be a very useful piece of code!
>
> This is written using ADODB (we're on SQL server) but can use DAO recordset
> as well. At present I have a form with text fields for subject,message, and
> file path to attach that I pass in, and the email addresses are passed in
> from the 1st query column (rs(0)).
>
> Private Sub Command0_Click()
> On Error GoTo Err_Command0_Click
>
> Dim objOutlook As New Outlook.Application
> Dim objMail As MailItem
> Dim rs As ADODB.Recordset
> ' > are not empty or null>
> Set rs = New ADODB.Recordset
> rs.Open "SELECT * FROM WHERE ",
> CurrentProject.Connection, adOpenDynamic, adLockOptimistic
> With rs
>
> Do Until rs.EOF
>
>
> Set objOutlook = New Outlook.Application
> Set objMail = objOutlook.CreateItem(olMailItem)
>
> EmailAddr = rs(0)
> 'CopyEmailAddr =
> Subj =
> Body =
> PathName =
>
> With objMail
> .To = EmailAddr
> .cc = CopyEmailAddr
> .Subject = Subj
> .Body = Body
> .NoAging = True
> If IsNull(PathName) = False Then
> .Attachments.Add PathName
> End If
> .Display
> End With
> 'Here is the problem area
> SendKeys "%{s}", True 'send the email without prompts
> 'End of problem area
> rs.MoveNext
>
> Loop
>
> Set objMail = Nothing
> Set objOutlook = Nothing
> End With
> Exit_Command0_Click:
> Exit Sub
>
> Err_Command0_Click:
> '
> MsgBox Err.Description
> End If
> Resume Exit_Command0_Click
>
> End Sub
>
> If anyone can add to this, post it here so we can all benefit (me too!).
>
> Andy
>
> --
> A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
> Murphy
>
> Message posted via http://www.accessmonster.com
>

Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:03 AM
Danny J. Lesandrini's Avatar Danny J. Lesandrini
Guest
 
Posts: n/a
   
   
Re: Send mail in Office XP WITHOUT warnings: the 99% solution

Try JMail ...

http://amazecreations.com/datafast/G...e=A97Jmail.zip

--

Danny J. Lesandrini
dlesandrini@hotmail.com
http://amazecreations.com/datafast
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522


"serviceman via AccessMonster.com" wrote in message news:6024c5667a857@uwe...
> Ok gang,
> I've been getting wonderful advice and tips from this site, and now I have
> something to give back (maybe!):
> The following script to send a single email was found on an MSDN tech page,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
> but for the life of me I can't find the link (damned that delete history
> button! I added the loop portion and changed the file lookup for
> attachments a bit.
> The following code will loop through a query and send an email to each email
> address WITHOUT ANY SECURITY WARNINGS. This apparently works only with Office
> XP...



Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:03 AM
serviceman via AccessMonster.com's Avatar serviceman via AccessMonster.com
Guest
 
Posts: n/a
   
   
RE: Send mail in Office XP WITHOUT warnings: the 99% solution

  Donate Today!  
Hey schasteen,
Yup, that works fine with an SMTP server environment; What I posted is set up
to work with your regular email client on the workstation if no SMTP server
is available. It would be nice if Microsoft would get their head out or their
keester and allow security functionality to be configured (Exchange allows
the admin to turn off those warnings), but that is a pipe dream for sure...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
Andy

schasteen wrote:
>This is a way to avoid outlook and the sendkey and uses cdo. There are
>limitations with operating systems. I know XP is OK, but I forget the rest
>off the top of my head. Microsoft has more information about using this
>method.
>
> Const cdoSendUsingPort = 2
> Const cdoBasic = 1
> Dim objCDOConfig As Object, objCDOMessage As Object
> Dim strSch As String
>
> strSch = "http://schemas.microsoft.com/cdo/configuration/"
> Set objCDOConfig = CreateObject("CDO.Configuration")
> With objCDOConfig.Fields
> .Item(strSch & "sendusing") = cdoSendUsingPort
> .Item(strSch & "smtpserver") = "ExchangeServerName"
>
> .Item(strSch & "SMTPAuthenticate") = cdoBasic
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9522
> .Item(strSch & "SendUserName") = "User@domain.com"
> .Item(strSch & "SendPassword") = "AccountPassword"
> .Update
> End With
>
> Set objCDOMessage = CreateObject("CDO.Message")
> With objCDOMessage
> Set .Configuration = objCDOConfig
> .FROM = "User"
> .Sender = "User"
> .To = SendTo
> .Cc = SendCc
> .Subject = SendSubject
> .TextBody = SendBody
> If Len(SendAttachment) > 0 Then
> .AddAttachment SendAttachment
> End If
> .Send
> End With
> Set objCDOMessage = Nothing
> Set objCDOConfig = Nothing
>
>> Ok gang,
>> I've been getting wonderful advice and tips from this site, and now I have

>[quoted text clipped - 83 lines]
>>
>> Andy


--
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200605/1
Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism need urgent advice.......
Today 10:41 AM
8 Replies, 92 Views
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 355 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,042 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 54 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 121 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,843 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 231 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,278 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 47 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 68 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 49 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 417 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 52 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,259 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 10:57 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.49352 seconds with 30 queries