backoffice
asked on
Is this this programming correect for emailing?
Set oRS = Nothing
MailText = MailText & "<br><br>This email was sent as a system test .<br>"
MailText = MailText & "Please contact REB for further details, or to be removed from the email list<br>"
MailText = MailText & "</body></html>"
If Not(MailTo = "")Then
Set EmailAlert = CreateObject("Outlook.Appl ication")
Set EmailNameSpace = EmailAlert.GetNameSpace("m apiprofile name")
Set MailIitem = EmailAlert.CreateItem(0)
'MailItem.Recipients.Add MailTo
MailItem.Recipients.Add "gps@****.com"
MailItem.Subject = "PPCMS"
MailItem.HTMLBody = MailText
MailItem.Send
EmailNameSpace.Logoff
End If
MailTo = ""
MailText = ""
Next
Is this the correct scripting for using a mapi profile on a sql server? - it seems to run fine but doesnt seem to send any email!!
any help would be greatfully received..
Grant.
MailText = MailText & "<br><br>This email was sent as a system test .<br>"
MailText = MailText & "Please contact REB for further details, or to be removed from the email list<br>"
MailText = MailText & "</body></html>"
If Not(MailTo = "")Then
Set EmailAlert = CreateObject("Outlook.Appl
Set EmailNameSpace = EmailAlert.GetNameSpace("m
Set MailIitem = EmailAlert.CreateItem(0)
'MailItem.Recipients.Add MailTo
MailItem.Recipients.Add "gps@****.com"
MailItem.Subject = "PPCMS"
MailItem.HTMLBody = MailText
MailItem.Send
EmailNameSpace.Logoff
End If
MailTo = ""
MailText = ""
Next
Is this the correct scripting for using a mapi profile on a sql server? - it seems to run fine but doesnt seem to send any email!!
any help would be greatfully received..
Grant.
ASKER
I have got outlook installed on the server. and if i do a test email from outlook itr works fine... BUT it does not seem to accept email rom sql server... what settigs do i have to change to allow outlook to accept email from sqlserver?
What versions of:
OS:
SQL Server:
Outlook:
Preece
OS:
SQL Server:
Outlook:
Preece
ASKER
OS win 2000
SQL 2000 + sp3a
Outlook 2000
when i test sql mail i get the following error:
error 18025 xp_test_mapi_profile failed with mail error 0x80040111
i have checked the mapi name and it is correct and i have sent a test email from outlook to myself..
When i type in the name of the profile i get the messaage that it isnt found on this computer BUT i assure you the profile is there and it is the correct name...
any suggestions..?
SQL 2000 + sp3a
Outlook 2000
when i test sql mail i get the following error:
error 18025 xp_test_mapi_profile failed with mail error 0x80040111
i have checked the mapi name and it is correct and i have sent a test email from outlook to myself..
When i type in the name of the profile i get the messaage that it isnt found on this computer BUT i assure you the profile is there and it is the correct name...
any suggestions..?
Also, have a look at:
https://www.experts-exchange.com/questions/21057886/xp-sendmail-not-working-but-outlook-is-working.html?query=xp_sendmail+not+working&clearTAFilter=true
https://www.experts-exchange.com/questions/20666534/xp-sendmail-not-working-please-help.html?query=xp_sendmail+not+working&clearTAFilter=true
https://www.experts-exchange.com/questions/20381586/Proper-configuration-of-SQL-Mail-or-removing-it.html?query=outlook+sql+server+email+not+sending&clearTAFilter=true
https://www.experts-exchange.com/questions/20837164/SQL-2000-Maintenance-Plans-not-emailing.html?query=outlook+sql+server+won't+send+email&clearTAFilter=true
https://www.experts-exchange.com/questions/10437196/xp-sendmail-quits-working.html?query=xp_sendmail+not+working&clearTAFilter=true
https://www.experts-exchange.com/questions/21057886/xp-sendmail-not-working-but-outlook-is-working.html?query=xp_sendmail+not+working&clearTAFilter=true
https://www.experts-exchange.com/questions/20666534/xp-sendmail-not-working-please-help.html?query=xp_sendmail+not+working&clearTAFilter=true
https://www.experts-exchange.com/questions/20381586/Proper-configuration-of-SQL-Mail-or-removing-it.html?query=outlook+sql+server+email+not+sending&clearTAFilter=true
https://www.experts-exchange.com/questions/20837164/SQL-2000-Maintenance-Plans-not-emailing.html?query=outlook+sql+server+won't+send+email&clearTAFilter=true
https://www.experts-exchange.com/questions/10437196/xp-sendmail-quits-working.html?query=xp_sendmail+not+working&clearTAFilter=true
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
- Also, it seems that you may need to provide more complete html in your MailText. This:
MailText = MailText & "<br><br>This email was sent as a system test .<br>"
MailText = MailText & "Please contact REB for further details, or to be removed from the email list<br>"
MailText = MailText & "</body></html>"
may need to look more like:
MailText = MailText & "<html><head></head><body>
MailText = MailText & "<br><br>This email was sent as a system test .<br>"
MailText = MailText & "Please contact REB for further details, or to be removed from the email list<br>"
MailText = MailText & "</body></html>"
Preece