Solved

ASP Email Question

Posted on 2012-04-04
3
289 Views
Last Modified: 2012-04-07
I am using this following code to send email via classic asp.

It all works fine if I use the correct mailFrom... but In case I change the fromEmail, it doesn;t work. I need to send invites in my application and the from email should be the agents email address and not my site's email address. Is there any way I can change it>

		Sub sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer, mailUsername, mailPassword)
			Set MyMail = CreateObject("cdo.message")
			MyMail.From = mailFrom
			MyMail.To = mailTo
			MyMail.Subject = mailSubject
			MyMail.HTMLBody = mailMessage
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailServer
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = mailUsername
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = mailPassword
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
			MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
			MyMail.Configuration.Fields.Update
			MyMail.Send
			Set MyMail = nothing
		End Sub

Open in new window

0
Comment
Question by:Aanvik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 37808288
the problem is most possible with mail server/smtp configuration that set up so check mailFrom is originated on the site , admin should change it to be able to orginate elsewhere
0
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 500 total points
ID: 37808306
I use "Google Apps" as my Hosting provider has a screwed up mail server setup that everything gets marked as spam.

So.
With Google Apps, I have to assign the account that is used in my Mail Forms, as "Administrator". If it is a basic account, it will not work.

I am unsure what mail hosting you are using, but if you have a way of making the accounts as "Administrator" then give it a shot, and try the mail again.

Good Luck
Carrzkiss
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37808701
Many web hosts will not allow you to send from an email address that does not exist on your account.  That's considered to be sending spam.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question